Skip to content

Commit

Permalink
Silence WebdriverIO deprecation warning caused by @vitest/browser
Browse files Browse the repository at this point in the history
  • Loading branch information
FiloSottile committed Jan 20, 2025
1 parent 419a057 commit 6e37393
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/setup.chrome.ts
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)
}
}
1 change: 1 addition & 0 deletions vitest.workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default defineWorkspace([
readTestkitFile,
},
},
globalSetup: "tests/setup.chrome.ts",
},
},
])

0 comments on commit 6e37393

Please sign in to comment.