Skip to content

Commit

Permalink
chore: run CI on Node 14 (#9861)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Apr 22, 2020
1 parent 7a7710d commit e7ff5b4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
fail-fast: false
matrix:
# https://github.com/actions/setup-node/issues/27
node-version: [8.17.0, 10.x, 12.x, 13.x]
node-version: [8.17.0, 10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`on node >=12.16.0 runs test with native ESM 1`] = `
exports[`on node ^12.16.0 || >=13.2.0 runs test with native ESM 1`] = `
Test Suites: 1 passed, 1 total
Tests: 10 passed, 10 total
Snapshots: 0 total
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/nativeEsm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('test config is without transform', () => {
});

// The versions vm.Module was introduced
onNodeVersions('>=12.16.0', () => {
onNodeVersions('^12.16.0 || >=13.2.0', () => {
test('runs test with native ESM', () => {
const {exitCode, stderr, stdout} = runJest(DIR, [], {
nodeOptions: '--experimental-vm-modules',
Expand Down
19 changes: 8 additions & 11 deletions packages/jest-cli/src/init/__tests__/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as path from 'path';
import prompts from 'prompts';
import {constants} from 'jest-config';
import init from '../';
import {onNodeVersions} from '@jest/test-utils';

const {JEST_CONFIG_EXT_ORDER} = constants;

Expand Down Expand Up @@ -56,20 +55,18 @@ describe('init', () => {
expect(evaluatedConfig).toEqual({});
});

onNodeVersions('^13.2.0', () => {
it('should generate empty config with mjs extension', async () => {
prompts.mockReturnValueOnce({});
it('should generate empty config with mjs extension', async () => {
prompts.mockReturnValueOnce({});

await init(resolveFromFixture('type_module'));
await init(resolveFromFixture('type_module'));

const writtenJestConfigFilename = fs.writeFileSync.mock.calls[0][0];
const writtenJestConfig = fs.writeFileSync.mock.calls[0][1];
const writtenJestConfigFilename = fs.writeFileSync.mock.calls[0][0];
const writtenJestConfig = fs.writeFileSync.mock.calls[0][1];

expect(writtenJestConfigFilename.endsWith('.mjs')).toBe(true);
expect(writtenJestConfigFilename.endsWith('.mjs')).toBe(true);

expect(typeof writtenJestConfig).toBe('string');
expect(writtenJestConfig.split('\n')[3]).toBe('export default {');
});
expect(typeof writtenJestConfig).toBe('string');
expect(writtenJestConfig.split('\n')[3]).toBe('export default {');
});
});

Expand Down

0 comments on commit e7ff5b4

Please sign in to comment.