Skip to content

Commit

Permalink
Native async integration (jestjs#3237)
Browse files Browse the repository at this point in the history
* Make native-async-mock test run on Node >=7.6 only

* Use yarn to install integration deps
  • Loading branch information
thymikee authored and aaronabramov committed Mar 31, 2017
1 parent 7e5feaa commit 40efbaa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 24 deletions.

This file was deleted.

2 changes: 1 addition & 1 deletion integration_tests/__tests__/coverage-remapping-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ skipOnWindows.suite();

it('maps code coverage against original source', () => {
const dir = path.resolve(__dirname, '../coverage-remapping');
run('npm install', dir);
run('yarn --no-lockfile', dir);
runJest(dir, ['--coverage', '--mapCoverage', '--no-cache']);

const coverageMapFile = path.join(
Expand Down
9 changes: 7 additions & 2 deletions integration_tests/__tests__/native-async-mock-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ skipOnWindows.suite();
const dir = path.resolve(__dirname, '..', 'native-async-mock');

test('mocks async functions', () => {
if (process.versions.node < '7.6.0') {
return;
}
if (process.platform !== 'win32') {
run('npm install', dir);
run('yarn --no-lockfile', dir);
linkJestPackage('babel-jest', dir);
}
// --no-cache because babel can cache stuff and result in false green
const {stderr} = runJest(dir, ['--no-cache']);
expect(extractSummary(stderr)).toMatchSnapshot();
expect(extractSummary(stderr).summary).toMatch(
'Test Suites: 1 passed, 1 total',
);
});
4 changes: 2 additions & 2 deletions integration_tests/__tests__/transform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('babel-jest', () => {

beforeEach(() => {
if (process.platform !== 'win32') {
run('npm install', dir);
run('yarn --no-lockfile', dir);
linkJestPackage('babel-jest', dir);
}
});
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('multiple-transformers', () => {

beforeEach(() => {
if (process.platform !== 'win32') {
run('npm install', dir);
run('yarn --no-lockfile', dir);
linkJestPackage('babel-jest', dir);
}
});
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/__tests__/typescript-coverage-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ skipOnWindows.suite();

it('instruments and collects coverage for typescript files', () => {
const dir = path.resolve(__dirname, '../typescript-coverage');
run('npm install', dir);
run('yarn --no-lockfile', dir);
const {stdout} = runJest(dir, ['--coverage', '--no-cache']);
expect(stdout).toMatchSnapshot();
});
3 changes: 1 addition & 2 deletions integration_tests/native-async-mock/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
"presets": ["es2015"]
}

0 comments on commit 40efbaa

Please sign in to comment.