diff --git a/packages/snapshot/src/port/state.ts b/packages/snapshot/src/port/state.ts index 89e777e4155f..8fb02b1fca3b 100644 --- a/packages/snapshot/src/port/state.ts +++ b/packages/snapshot/src/port/state.ts @@ -109,7 +109,10 @@ export default class SnapshotState { markSnapshotsAsCheckedForTest(testName: string): void { this._uncheckedKeys.forEach((uncheckedKey) => { - if (keyToTestName(uncheckedKey) === testName) { + // skip snapshots with following keys + // testName n + // testName > xxx n (this is for toMatchSnapshot("xxx") API) + if (/ \d+$| > /.test(uncheckedKey.slice(testName.length))) { this._uncheckedKeys.delete(uncheckedKey) } })