Skip to content

Commit 7702f44

Browse files
committed
Unstuck mocha types
See diff.
1 parent 5317b79 commit 7702f44

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lib/helpers/dry-run.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ globalThis[globalPropertyName] = {
88
afterEach: globalThis.afterEach,
99
};
1010

11-
window.before = () => {};
12-
window.beforeEach = () => {};
13-
window.after = () => {};
14-
window.afterEach = () => {};
11+
/**
12+
* {} isn't strictly speaking a Mocha.Hook, so if Cypress decides to update their shipped Mocha
13+
* version to v11, which introduces #5231 [1], then this might become problematic. The
14+
* @types/mocha package did however update their types within its v10 line.
15+
*
16+
* [1] https://github.com/mochajs/mocha/issues/5231
17+
*/
18+
window.before = () => ({}) as Mocha.Hook;
19+
window.beforeEach = () => ({}) as Mocha.Hook;
20+
window.after = () => ({}) as Mocha.Hook;
21+
window.afterEach = () => ({}) as Mocha.Hook;

0 commit comments

Comments
 (0)