Skip to content

Commit

Permalink
Unstuck mocha types
Browse files Browse the repository at this point in the history
See diff.
  • Loading branch information
badeball committed Dec 3, 2024
1 parent 5317b79 commit 7702f44
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/helpers/dry-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ globalThis[globalPropertyName] = {
afterEach: globalThis.afterEach,
};

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

0 comments on commit 7702f44

Please sign in to comment.