* Overrides skipTest() with a more robust version of `this.skip()`. See #17245.
()
| 103 | * Overrides skipTest() with a more robust version of `this.skip()`. See #17245. |
| 104 | */ |
| 105 | function overrideSkipTest() { |
| 106 | this.skipTest = function () { |
| 107 | if (!this._runnable.title.startsWith('"before all" hook')) { |
| 108 | throw new Error('skipTest() can only be called from within before()'); |
| 109 | } |
| 110 | this.test.parent.pending = true; // Workaround for mochajs/mocha#2683. |
| 111 | this.skip(); |
| 112 | }; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Sets up the initial state required by individual test cases. |