Skip to content

Commit

Permalink
test: e2e skip warning message (#12713)
Browse files Browse the repository at this point in the history
* test: e2e skip warning message

---------

Co-authored-by: Ivan_Chen <[email protected]>
  • Loading branch information
ayachensiyuan and Ivan_Chen authored Nov 13, 2024
1 parent c59b926 commit 9802f8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/tests/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ export enum LocalDebugError {
ElementNotInteractableError = "ElementNotInteractableError",
TimeoutError = "TimeoutError",
WarningError = "Warning",
DeprecatedError = "npm warn deprecated",
}

export class LocalDebugTaskInfo {
Expand Down
8 changes: 5 additions & 3 deletions packages/tests/src/utils/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
} from "child_process";
import { expect } from "chai";
import { Env } from "./env";
import { on } from "events";

export class Executor {
static async execute(
Expand All @@ -45,8 +44,11 @@ export class Executor {

if (result.stderr) {
if (
skipErrorMessage &&
result.stderr.toLowerCase().includes(skipErrorMessage)
(skipErrorMessage &&
result.stderr.toLowerCase().includes(skipErrorMessage)) ||
result.stderr
.toLowerCase()
.includes(LocalDebugError.DeprecatedError)
) {
console.log(`[Skip Warning] ${result.stderr}`);
return { success: true, ...result };
Expand Down

0 comments on commit 9802f8d

Please sign in to comment.