Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Apr 14, 2019
1 parent 8d17e2e commit 7f464d8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 38 deletions.
67 changes: 30 additions & 37 deletions e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap
@@ -1,68 +1,61 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`defining tests and hooks asynchronously throws 1`] = `
"FAIL __tests__/asyncDefinition.test.js
FAIL __tests__/asyncDefinition.test.js
● Test suite failed to run
Cannot add a test after tests have started running. Tests must be defined synchronously.
3 |
4 | Promise.resolve().then(() => {
> 5 | test('async definition inside describe', () => {});
| ^
6 | afterAll(() => {});
7 | });
8 | });
10 |
11 | Promise.resolve().then(() => {
> 12 | test('async definition inside describe', () => {});
| ^
13 | afterAll(() => {});
14 | });
15 | });
at test (__tests__/asyncDefinition.test.js:5:5)
at test (__tests__/asyncDefinition.test.js:12:5)
● Test suite failed to run
Cannot add a hook after tests have started running. Hooks must be defined synchronously.
4 | Promise.resolve().then(() => {
5 | test('async definition inside describe', () => {});
> 6 | afterAll(() => {});
| ^
7 | });
8 | });
9 |
11 | Promise.resolve().then(() => {
12 | test('async definition inside describe', () => {});
> 13 | afterAll(() => {});
| ^
14 | });
15 | });
16 |
at afterAll (__tests__/asyncDefinition.test.js:6:5)
at afterAll (__tests__/asyncDefinition.test.js:13:5)
● Test suite failed to run
Cannot add a test after tests have started running. Tests must be defined synchronously.
9 |
10 | Promise.resolve().then(() => {
> 11 | test('async definition outside describe', () => {});
16 |
17 | Promise.resolve().then(() => {
> 18 | test('async definition outside describe', () => {});
| ^
12 | afterAll(() => {});
13 | });
14 |
19 | afterAll(() => {});
20 | });
21 |
at test (__tests__/asyncDefinition.test.js:11:3)
at test (__tests__/asyncDefinition.test.js:18:3)
● Test suite failed to run
Cannot add a hook after tests have started running. Hooks must be defined synchronously.
10 | Promise.resolve().then(() => {
11 | test('async definition outside describe', () => {});
> 12 | afterAll(() => {});
17 | Promise.resolve().then(() => {
18 | test('async definition outside describe', () => {});
> 19 | afterAll(() => {});
| ^
13 | });
14 |
20 | });
21 |
at afterAll (__tests__/asyncDefinition.test.js:12:3)
Test Suites: 1 failed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.281s, estimated 1s
Ran all test suites matching /asyncDefinition.test.js/i.
"
at afterAll (__tests__/asyncDefinition.test.js:19:3)
`;
6 changes: 5 additions & 1 deletion e2e/__tests__/circusDeclarationErrors.test.ts
Expand Up @@ -6,6 +6,8 @@
*/

import {skipSuiteOnJasmine} from '@jest/test-utils';
import {wrap} from 'jest-snapshot-serializer-raw';
import {extractSummary} from '../Utils';
import runJest from '../runJest';

skipSuiteOnJasmine();
Expand All @@ -16,5 +18,7 @@ it('defining tests and hooks asynchronously throws', () => {
]);

expect(result.status).toBe(1);
expect(result.stderr).toMatchSnapshot();

const {rest} = extractSummary(result.stderr);
expect(wrap(rest)).toMatchSnapshot();
});
@@ -1,3 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

describe('describe', () => {
test('correct test def', () => {});

Expand Down

0 comments on commit 7f464d8

Please sign in to comment.