(testId: string)
| 151 | } |
| 152 | |
| 153 | clearTest(testId: string): void { |
| 154 | // clear inline |
| 155 | this._inlineSnapshots = this._inlineSnapshots.filter(s => s.testId !== testId) |
| 156 | this._inlineSnapshotStacks = this._inlineSnapshotStacks.filter(s => s.testId !== testId) |
| 157 | |
| 158 | // clear file |
| 159 | for (const key of this._testIdToKeys.get(testId)) { |
| 160 | const name = keyToTestName(key) |
| 161 | const count = this._counters.get(name) |
| 162 | if (count > 0) { |
| 163 | if (key in this._snapshotData || key in this._initialData) { |
| 164 | this._snapshotData[key] = this._initialData[key] |
| 165 | } |
| 166 | this._counters.set(name, count - 1) |
| 167 | } |
| 168 | } |
| 169 | this._testIdToKeys.delete(testId) |
| 170 | |
| 171 | // clear stats |
| 172 | this.added.delete(testId) |
| 173 | this.updated.delete(testId) |
| 174 | this.matched.delete(testId) |
| 175 | this.unmatched.delete(testId) |
| 176 | } |
| 177 | |
| 178 | protected _inferInlineSnapshotStack(stacks: ParsedStack[]): ParsedStack | null { |
| 179 | // if called inside resolves/rejects, stacktrace is different |
nothing calls this directly
no test coverage detected