Skip to content

Commit

Permalink
skip test retry test on jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 23, 2020
1 parent 384285b commit 9da97c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 53 deletions.
9 changes: 4 additions & 5 deletions e2e/__tests__/circusConcurrentEach.test.ts
Expand Up @@ -4,13 +4,13 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {skipSuiteOnJasmine} from '@jest/test-utils';
import {json as runWithJson} from '../runJest';

skipSuiteOnJasmine();

it('works with concurrent.each', () => {
const {json} = runWithJson('circus-concurrent', [
'concurrent-each.test.js',
'--testRunner=jest-circus/runner',
]);
const {json} = runWithJson('circus-concurrent', ['concurrent-each.test.js']);
expect(json.numTotalTests).toBe(4);
expect(json.numPassedTests).toBe(2);
expect(json.numFailedTests).toBe(0);
Expand All @@ -20,7 +20,6 @@ it('works with concurrent.each', () => {
it('works with concurrent.only.each', () => {
const {json} = runWithJson('circus-concurrent', [
'concurrent-only-each.test.js',
'--testRunner=jest-circus/runner',
]);
expect(json.numTotalTests).toBe(4);
expect(json.numPassedTests).toBe(2);
Expand Down
31 changes: 7 additions & 24 deletions e2e/__tests__/toMatchInlineSnapshotWithRetries.test.ts
Expand Up @@ -6,6 +6,7 @@
*/

import * as path from 'path';
import {skipSuiteOnJasmine} from '@jest/test-utils';
import {cleanup, makeTemplate, writeFiles} from '../Utils';
import runJest from '../runJest';

Expand All @@ -15,6 +16,8 @@ const TESTS_DIR = path.resolve(DIR, '__tests__');
beforeEach(() => cleanup(TESTS_DIR));
afterAll(() => cleanup(TESTS_DIR));

skipSuiteOnJasmine();

test('works with a single snapshot', () => {
const filename = 'basic-support.test.js';
const template = makeTemplate(`
Expand All @@ -39,12 +42,7 @@ test('works with a single snapshot', () => {
writeFiles(TESTS_DIR, {
[filename]: template(['index', '2' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Received: 2');
expect(stderr).toMatch('1 snapshot failed from 1 test suite.');
expect(exitCode).toBe(1);
Expand All @@ -54,12 +52,7 @@ test('works with a single snapshot', () => {
writeFiles(TESTS_DIR, {
[filename]: template(['index', '4' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Snapshots: 1 passed, 1 total');
expect(exitCode).toBe(0);
}
Expand Down Expand Up @@ -113,12 +106,7 @@ test('works when multiple tests have snapshots but only one of them failed multi
writeFiles(TESTS_DIR, {
[filename]: template(['index', '2' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Snapshot name: `with retries snapshots 1`');
expect(stderr).toMatch('Received: 2');
expect(stderr).toMatch('1 snapshot failed from 1 test suite.');
Expand All @@ -129,12 +117,7 @@ test('works when multiple tests have snapshots but only one of them failed multi
writeFiles(TESTS_DIR, {
[filename]: template(['index', '4' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Snapshots: 1 passed, 1 total');
expect(exitCode).toBe(0);
}
Expand Down
31 changes: 7 additions & 24 deletions e2e/__tests__/toMatchSnapshotWithRetries.test.ts
Expand Up @@ -6,6 +6,7 @@
*/

import * as path from 'path';
import {skipSuiteOnJasmine} from '@jest/test-utils';
import {cleanup, makeTemplate, writeFiles} from '../Utils';
import runJest from '../runJest';

Expand All @@ -15,6 +16,8 @@ const TESTS_DIR = path.resolve(DIR, '__tests__');
beforeEach(() => cleanup(TESTS_DIR));
afterAll(() => cleanup(TESTS_DIR));

skipSuiteOnJasmine();

test('works with a single snapshot', () => {
const filename = 'basic-support.test.js';
const template = makeTemplate(`
Expand All @@ -39,12 +42,7 @@ test('works with a single snapshot', () => {
writeFiles(TESTS_DIR, {
[filename]: template(['index', '2' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Received: 2');
expect(stderr).toMatch('1 snapshot failed from 1 test suite.');
expect(exitCode).toBe(1);
Expand All @@ -54,12 +52,7 @@ test('works with a single snapshot', () => {
writeFiles(TESTS_DIR, {
[filename]: template(['index', '4' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Snapshots: 1 passed, 1 total');
expect(exitCode).toBe(0);
}
Expand Down Expand Up @@ -92,12 +85,7 @@ test('works when multiple tests have snapshots but only one of them failed multi
writeFiles(TESTS_DIR, {
[filename]: template(['index', '2' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Received: 2');
expect(stderr).toMatch('1 snapshot failed from 1 test suite.');
expect(exitCode).toBe(1);
Expand All @@ -107,12 +95,7 @@ test('works when multiple tests have snapshots but only one of them failed multi
writeFiles(TESTS_DIR, {
[filename]: template(['index', '4' /* retries */]),
});
const {stderr, exitCode} = runJest(DIR, [
'-w=1',
'--ci=false',
'--testRunner=jest-circus/runner',
filename,
]);
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Snapshots: 1 passed, 1 total');
expect(exitCode).toBe(0);
}
Expand Down

0 comments on commit 9da97c6

Please sign in to comment.