From 7f464d85671e319152f716d07985245c74754bab Mon Sep 17 00:00:00 2001 From: Tim Seckinger Date: Sat, 9 Mar 2019 19:24:13 +0100 Subject: [PATCH] fix CI --- .../circusDeclarationErrors.test.ts.snap | 67 +++++++++---------- e2e/__tests__/circusDeclarationErrors.test.ts | 6 +- .../__tests__/asyncDefinition.test.js | 7 ++ 3 files changed, 42 insertions(+), 38 deletions(-) diff --git a/e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap b/e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap index 4771d15ef42f..83a0e4eab83d 100644 --- a/e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap +++ b/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) `; diff --git a/e2e/__tests__/circusDeclarationErrors.test.ts b/e2e/__tests__/circusDeclarationErrors.test.ts index 119624b79186..14b965b3f98e 100644 --- a/e2e/__tests__/circusDeclarationErrors.test.ts +++ b/e2e/__tests__/circusDeclarationErrors.test.ts @@ -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(); @@ -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(); }); diff --git a/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js b/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js index 1baed83c7f14..5a519faa3be7 100644 --- a/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js +++ b/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js @@ -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', () => {});