-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Silence WebdriverIO deprecation warning caused by @vitest/browser
Inspired by canalplus/rx-player#1618. See vitest-dev/vitest#6804.
- Loading branch information
1 parent
419a057
commit 6e37393
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const realConsoleWarn = console.warn | ||
|
||
// https://github.com/vitest-dev/vitest/issues/6804 | ||
const annoyingWarning = `⚠️ [WEBDRIVERIO DEPRECATION NOTICE] The "switchToFrame" command is deprecated` | ||
|
||
export default function setup() { | ||
console.warn = function (...args) { | ||
if (typeof args[0] === "string" && args[0].startsWith(annoyingWarning)) { | ||
return | ||
} | ||
return realConsoleWarn.apply(console, args) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ export default defineWorkspace([ | |
readTestkitFile, | ||
}, | ||
}, | ||
globalSetup: "tests/setup.chrome.ts", | ||
}, | ||
}, | ||
]) |