-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also adds some more tests in the integration tests part
- Loading branch information
1 parent
5e6e211
commit 00f5b32
Showing
9 changed files
with
106 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @emails oncall+jsinfra | ||
*/ | ||
'use strict'; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const runJest = require('../runJest'); | ||
|
||
describe('Snapshot', () => { | ||
it('works as expected', () => { | ||
const result = runJest.json('snapshot', []); | ||
const json = result.json; | ||
|
||
expect(json.numTotalTests).toBe(2); | ||
expect(json.numPassedTests).toBe(2); | ||
expect(json.numFailedTests).toBe(0); | ||
expect(json.numPendingTests).toBe(0); | ||
expect(result.status).toBe(0); | ||
|
||
const content = fs.readFileSync( | ||
path.resolve( | ||
__dirname, | ||
'../snapshot/__tests__/__snapshots__/snapshot.js.snap' | ||
) | ||
); | ||
|
||
const output = JSON.parse(content); | ||
expect( | ||
output['snapshot is not influenced by previous counter 0'] | ||
).not.toBe(undefined); | ||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters