Skip to content

Commit

Permalink
fix(snapshot): clear state (#370)
Browse files Browse the repository at this point in the history
Ensure clearing the snapshot state when rerunning tests
  • Loading branch information
stoffeastrom committed Sep 17, 2018
1 parent 65191bf commit d8b063e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 132 deletions.
1 change: 1 addition & 0 deletions commands/node/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class Runner extends EventEmitter {
}

setupAndRunTests(testFiles, srcFiles) {
this.snapshotStates.clear();
process.removeAllListeners();
if (this.mochaRunner) {
this.mochaRunner.removeAllListeners();
Expand Down
36 changes: 0 additions & 36 deletions examples/react/test/__snapshots__/button.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,8 @@ exports[`'renders correctly' 2`] = `
</button>
`;

exports[`'renders correctly' 3`] = `
<button>
Text
</button>
`;

exports[`'renders correctly' 4`] = `
<button>
Text1
</button>
`;

exports[`'renders correctly' 5`] = `
<button>
Text
</button>
`;

exports[`'renders correctly' 6`] = `
<button>
Text1
</button>
`;

exports[`'renders fancy' 1`] = `
<button>
fancy1
</button>
`;

exports[`'renders fancy' 2`] = `
<button>
fancy1
</button>
`;

exports[`'renders fancy' 3`] = `
<button>
fancy1
</button>
`;
96 changes: 0 additions & 96 deletions examples/react/test/__snapshots__/fancy-button.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ exports[`'renders fancy with button as is from import' 1`] = `
</div>
`;

exports[`'renders fancy with button as is from import' 2`] = `
<div>
<button>
fancy1
</button>
</div>
`;

exports[`'renders fancy with button as is from import' 3`] = `
<div>
<button>
fancy1
</button>
</div>
`;

exports[`'renders fancy with button as is' 1`] = `
<div>
<button>
Expand All @@ -32,22 +16,6 @@ exports[`'renders fancy with button as is' 1`] = `
</div>
`;

exports[`'renders fancy with button as is' 2`] = `
<div>
<button>
pancy
</button>
</div>
`;

exports[`'renders fancy with button as is' 3`] = `
<div>
<button>
pancy
</button>
</div>
`;

exports[`'renders fancy with button as span or div' 1`] = `
<div>
<span>
Expand All @@ -64,74 +32,10 @@ exports[`'renders fancy with button as span or div' 2`] = `
</div>
`;

exports[`'renders fancy with button as span or div' 3`] = `
<div>
<span>
hhhhh
</span>
</div>
`;

exports[`'renders fancy with button as span or div' 4`] = `
<div>
<div>
ggggg
</div>
</div>
`;

exports[`'renders fancy with button as span or div' 5`] = `
<div>
<span>
hhhhh
</span>
</div>
`;

exports[`'renders fancy with button as span or div' 6`] = `
<div>
<div>
ggggg
</div>
</div>
`;

exports[`'renders fancy with button as span' 1`] = `
<div>
<span>
hhhhh
</span>
</div>
`;

exports[`'renders fancy with button as span' 2`] = `
<div>
<div>
ggggg
</div>
</div>
`;

exports[`'renders fancy with button mock from file' 1`] = `
<div>
<span>
file mock
</span>
</div>
`;

exports[`'renders fancy with button mock from file' 2`] = `
<div>
<span>
file mock
</span>
</div>
`;

exports[`'renders fancy with button mock from file' 3`] = `
<div>
<span>
file mock
</span>
</div>
`;

0 comments on commit d8b063e

Please sign in to comment.