Skip to content

Commit

Permalink
fix(tests): do not use babel in our tests + new API for simple
Browse files Browse the repository at this point in the history
  • Loading branch information
huafu committed Aug 8, 2018
1 parent 34a41ea commit 3e4de3e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 341 deletions.
48 changes: 48 additions & 0 deletions e2e/__tests__/__snapshots__/simple.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Simple test should pass with each template 1`] = `
Object {
"default": jest exit code: 0
===[ STDOUT ]===================================================================
===[ STDERR ]===================================================================
PASS __tests__/Hello.test.ts
Hello Class
should create a new Hello (XXms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: XXs
Ran all test suites.
================================================================================,
"with-babel-7": jest exit code: 0
===[ STDOUT ]===================================================================
===[ STDERR ]===================================================================
PASS __tests__/Hello.test.ts
Hello Class
should create a new Hello (XXms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: XXs
Ran all test suites.
================================================================================,
"with-jest-22": jest exit code: 0
===[ STDOUT ]===================================================================
===[ STDERR ]===================================================================
PASS __tests__/Hello.test.ts
Hello Class
should create a new Hello (XXms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: XXs
Ran all test suites.
================================================================================,
}
`;
20 changes: 9 additions & 11 deletions e2e/__tests__/simple.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import configureTestCase from '../__helpers__/test-case';

describe('Simple test', () => {
it('should pass with babel 6', () => {
const testCase = configureTestCase('simple');
expect(testCase.run(0).status).toBe(0);
});
it('should pass with babel 7', () => {
const testCase = configureTestCase('simple', { template: 'with-babel-7' });
expect(testCase.run(0).status).toBe(0);
});
it('should pass with jest 22', () => {
const testCase = configureTestCase('simple', { template: 'with-jest-22' });
expect(testCase.run(0).status).toBe(0);
it('should pass with each template', () => {
const testCase = configureTestCase('simple', { args: ['--no-cache'] });
const result = testCase.runWithTemplates(
0,
'default',
'with-babel-7',
'with-jest-22',
);
expect(result).toMatchSnapshot();
});
});
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
globals: {
'ts-jest': {
tsConfig: 'tsconfig.base.json',
useBabelJest: false,
},
},
};
Loading

0 comments on commit 3e4de3e

Please sign in to comment.