File tree Expand file tree Collapse file tree
packages/web-application/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export class LoggerServer extends PluggableModule implements ILoggerServer {
5656 ) : Promise < void > {
5757 const queueItem = this . queue . shift ( ) ;
5858
59- if ( queueItem === undefined ) {
59+ if ( ! queueItem ) {
6060 this . status = LogQueueStatus . EMPTY ;
6161 return ;
6262 }
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export interface IStack<T> {
1313export interface IQueue < T > {
1414 push ( ...elements : Array < T > ) : void ;
1515
16- shift ( ) : T | void ;
16+ shift ( ) : T | undefined ;
1717
1818 clean ( ) : void ;
1919
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class Queue<T> implements IQueue<T> {
1515 this . array . push ( ...elements ) ;
1616 }
1717
18- public shift ( ) : T | void {
18+ public shift ( ) : T | undefined {
1919 return this . array . shift ( ) ;
2020 }
2121
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 XpathSelector ,
2020 ShadowCssSelector ,
2121 Selector ,
22+ isXpathSelector ,
2223} from '@testring/types' ;
2324
2425import { asyncBreakpoints } from '@testring/async-breakpoints' ;
@@ -225,12 +226,18 @@ export class WebApplication extends PluggableModule {
225226
226227 if ( this . config . devtool ) {
227228 try {
228- if ( normalizedXPath && normalizedXPath . type !== 'xpath' ) {
229- throw new Error (
230- `devtoolHighlight only supports xpath selectors. Received type: ${ normalizedXPath . type } , value: ${ JSON . stringify ( normalizedXPath ) } `
231- ) ;
229+ let xpathString : string | null = null ;
230+
231+ if ( normalizedXPath ) {
232+ if ( ! isXpathSelector ( normalizedXPath ) ) {
233+ throw new Error (
234+ `devtoolHighlight only supports xpath selectors. Received type: ${ normalizedXPath . type } , value: ${ JSON . stringify ( normalizedXPath ) } `
235+ ) ;
236+ }
237+
238+ xpathString = normalizedXPath . xpath ;
232239 }
233- const xpathString = normalizedXPath ? normalizedXPath . xpath : null ;
240+
234241 await this . client . execute ( ( addHighlightXpath : string ) => {
235242 window . postMessage (
236243 {
You can’t perform that action at this time.
0 commit comments