Skip to content

Commit 3e4de3e

Browse files
committed
fix(tests): do not use babel in our tests + new API for simple
1 parent 34a41ea commit 3e4de3e

5 files changed

Lines changed: 75 additions & 341 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Simple test should pass with each template 1`] = `
4+
Object {
5+
"default": jest exit code: 0
6+
===[ STDOUT ]===================================================================
7+
8+
===[ STDERR ]===================================================================
9+
PASS __tests__/Hello.test.ts
10+
Hello Class
11+
should create a new Hello (XXms)
12+
13+
Test Suites: 1 passed, 1 total
14+
Tests: 1 passed, 1 total
15+
Snapshots: 0 total
16+
Time: XXs
17+
Ran all test suites.
18+
================================================================================,
19+
"with-babel-7": jest exit code: 0
20+
===[ STDOUT ]===================================================================
21+
22+
===[ STDERR ]===================================================================
23+
PASS __tests__/Hello.test.ts
24+
Hello Class
25+
should create a new Hello (XXms)
26+
27+
Test Suites: 1 passed, 1 total
28+
Tests: 1 passed, 1 total
29+
Snapshots: 0 total
30+
Time: XXs
31+
Ran all test suites.
32+
================================================================================,
33+
"with-jest-22": jest exit code: 0
34+
===[ STDOUT ]===================================================================
35+
36+
===[ STDERR ]===================================================================
37+
PASS __tests__/Hello.test.ts
38+
Hello Class
39+
should create a new Hello (XXms)
40+
41+
Test Suites: 1 passed, 1 total
42+
Tests: 1 passed, 1 total
43+
Snapshots: 0 total
44+
Time: XXs
45+
Ran all test suites.
46+
================================================================================,
47+
}
48+
`;

e2e/__tests__/simple.spec.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import configureTestCase from '../__helpers__/test-case';
22

33
describe('Simple test', () => {
4-
it('should pass with babel 6', () => {
5-
const testCase = configureTestCase('simple');
6-
expect(testCase.run(0).status).toBe(0);
7-
});
8-
it('should pass with babel 7', () => {
9-
const testCase = configureTestCase('simple', { template: 'with-babel-7' });
10-
expect(testCase.run(0).status).toBe(0);
11-
});
12-
it('should pass with jest 22', () => {
13-
const testCase = configureTestCase('simple', { template: 'with-jest-22' });
14-
expect(testCase.run(0).status).toBe(0);
4+
it('should pass with each template', () => {
5+
const testCase = configureTestCase('simple', { args: ['--no-cache'] });
6+
const result = testCase.runWithTemplates(
7+
0,
8+
'default',
9+
'with-babel-7',
10+
'with-jest-22',
11+
);
12+
expect(result).toMatchSnapshot();
1513
});
1614
});

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
globals: {
1313
'ts-jest': {
1414
tsConfig: 'tsconfig.base.json',
15+
useBabelJest: false,
1516
},
1617
},
1718
};

0 commit comments

Comments
 (0)