Skip to content

Commit

Permalink
add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
F3n67u committed Mar 27, 2022
1 parent 1b0148c commit 93444ce
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions e2e/__tests__/__snapshots__/testMatch.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`testMatch should able to match file with cjs and mjs extension 1`] = `
"Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites."
`;
9 changes: 9 additions & 0 deletions e2e/__tests__/testMatch.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {extractSummary} from '../Utils';
import runJest from '../runJest';

it('testMatch should able to match file with cjs and mjs extension', () => {
const result = runJest('test-match');
expect(result.exitCode).toBe(0);
const {summary} = extractSummary(result.stderr);
expect(summary).toMatchSnapshot();
});
5 changes: 5 additions & 0 deletions e2e/test-match/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"jest": {
"testMatch": ["**/test-suites/*.?js"]
}
}
3 changes: 3 additions & 0 deletions e2e/test-match/test-suites/sample-suite.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('mjs extension', () => {
expect(1).toBe(1);
});
3 changes: 3 additions & 0 deletions e2e/test-match/test-suites/sample-suite2.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('cjs extension', () => {
expect(1).toBe(1);
});

0 comments on commit 93444ce

Please sign in to comment.