()
| 120 | } |
| 121 | |
| 122 | private checkMutation() { |
| 123 | if (this.runStarted) { |
| 124 | throw new Error("Cannot add to a suite that has already started running."); |
| 125 | } |
| 126 | if (Suite.globalStack.slice(-1)[0] !== this) { |
| 127 | throw new Error( |
| 128 | "Cannot add to a suite that is not currently in scope. Call ctx.suite, ctx.test, ctx.before/after instead." |
| 129 | ); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | private context(): ISuiteContext { |
| 134 | // The any types here are required due to method overloads. |