forked from jestjs/jest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for "beforeEach" in "test" behavior
- Loading branch information
Miguel Jimenez Esun
committed
Apr 30, 2018
1 parent
4c75933
commit 9cee675
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
integration-tests/__tests__/__snapshots__/before-each-queue.js.snap
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,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Correct beforeEach order ensures the correct order for beforeEach 1`] = ` | ||
" console.log __tests__/before-each-queue.test.js:3 | ||
BeforeEach | ||
console.log __tests__/before-each-queue.test.js:7 | ||
It Foo | ||
console.log __tests__/before-each-queue.test.js:10 | ||
BeforeEach Inline Foo | ||
console.log __tests__/before-each-queue.test.js:3 | ||
BeforeEach | ||
console.log __tests__/before-each-queue.test.js:15 | ||
It Bar | ||
" | ||
`; |
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,18 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
'use strict'; | ||
|
||
const runJest = require('../runJest'); | ||
|
||
describe('Correct beforeEach order', () => { | ||
it('ensures the correct order for beforeEach', () => { | ||
const result = runJest('before-each-queue'); | ||
expect(result.stdout).toMatchSnapshot(); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
integration-tests/before-each-queue/__tests__/before-each-queue.test.js
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,21 @@ | ||
describe('test', () => { | ||
beforeEach(() => { | ||
console.log('BeforeEach'); | ||
}); | ||
|
||
it('foo', () => { | ||
console.log('It Foo'); | ||
|
||
beforeEach(() => { | ||
console.log('BeforeEach Inline Foo'); | ||
}); | ||
}); | ||
|
||
it('bar', () => { | ||
console.log('It Bar'); | ||
|
||
beforeEach(() => { | ||
console.log('BeforeEach Inline Bar'); | ||
}); | ||
}); | ||
}); |
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 @@ | ||
{} |