Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/logger/src/logger-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class LoggerServer extends PluggableModule implements ILoggerServer {
): Promise<void> {
const queueItem = this.queue.shift();

if (queueItem === undefined) {
if (!queueItem) {
this.status = LogQueueStatus.EMPTY;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion core/types/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface IStack<T> {
export interface IQueue<T> {
push(...elements: Array<T>): void;

shift(): T | void;
shift(): T | undefined;

clean(): void;

Expand Down
2 changes: 1 addition & 1 deletion core/utils/src/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Queue<T> implements IQueue<T> {
this.array.push(...elements);
}

public shift(): T | void {
public shift(): T | undefined {
return this.array.shift();
}

Expand Down
17 changes: 12 additions & 5 deletions packages/web-application/src/web-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
XpathSelector,
ShadowCssSelector,
Selector,
isXpathSelector,
} from '@testring/types';

import {asyncBreakpoints} from '@testring/async-breakpoints';
Expand Down Expand Up @@ -225,12 +226,18 @@ export class WebApplication extends PluggableModule {

if (this.config.devtool) {
try {
if (normalizedXPath && normalizedXPath.type !== 'xpath') {
throw new Error(
`devtoolHighlight only supports xpath selectors. Received type: ${normalizedXPath.type}, value: ${JSON.stringify(normalizedXPath)}`
);
let xpathString: string | null = null;

if (normalizedXPath) {
if (!isXpathSelector(normalizedXPath)) {
throw new Error(
`devtoolHighlight only supports xpath selectors. Received type: ${normalizedXPath.type}, value: ${JSON.stringify(normalizedXPath)}`
);
}

xpathString = normalizedXPath.xpath;
}
const xpathString = normalizedXPath ? normalizedXPath.xpath : null;

await this.client.execute((addHighlightXpath: string) => {
window.postMessage(
{
Expand Down
Loading