Skip to content

Commit

Permalink
Passing test.key instead of test.name to expect and jest-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Walter committed May 8, 2019
1 parent 9000fce commit b3e56ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ worker({
assertionCalls: 0,
suppressedErrors: [],
snapshotState: getSnapshotState(file, context.updateSnapshot),
currentTestName: test.name
currentTestName: test.key
})

// Execute each function with the test context exported by the files
Expand Down Expand Up @@ -132,8 +132,8 @@ worker({
added: snapshotState.added,
updated: snapshotState.updated
}
for (let i = snapshotState._counters.get(test.name); i > 0; i--) {
const key = utils.testNameToKey(test.name, i)
for (let i = snapshotState._counters.get(test.key); i > 0; i--) {
const key = utils.testNameToKey(test.key, i)
testContext.result.snapshots[key] = snapshotState._snapshotData[key]
}
}
Expand Down

0 comments on commit b3e56ec

Please sign in to comment.