We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5317b79 commit 7702f44Copy full SHA for 7702f44
lib/helpers/dry-run.ts
@@ -8,7 +8,14 @@ globalThis[globalPropertyName] = {
8
afterEach: globalThis.afterEach,
9
};
10
11
-window.before = () => {};
12
-window.beforeEach = () => {};
13
-window.after = () => {};
14
-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.
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