|
| 1 | +/** |
| 2 | + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + */ |
| 7 | + |
| 8 | +import {skipSuiteOnJasmine} from '@jest/test-utils'; |
| 9 | +import runJest from '../runJest'; |
| 10 | + |
| 11 | +skipSuiteOnJasmine(); |
| 12 | + |
| 13 | +it('calls asynchronous handleTestEvent in testEnvironment', () => { |
| 14 | + const result = runJest('test-environment-circus-async'); |
| 15 | + expect(result.failed).toEqual(true); |
| 16 | + |
| 17 | + const lines = result.stdout.split('\n'); |
| 18 | + expect(lines).toMatchInlineSnapshot(` |
| 19 | + Array [ |
| 20 | + "setup", |
| 21 | + "warning: add_hook is a sync event", |
| 22 | + "warning: start_describe_definition is a sync event", |
| 23 | + "warning: add_hook is a sync event", |
| 24 | + "warning: add_hook is a sync event", |
| 25 | + "warning: add_test is a sync event", |
| 26 | + "warning: add_test is a sync event", |
| 27 | + "warning: finish_describe_definition is a sync event", |
| 28 | + "add_hook", |
| 29 | + "start_describe_definition", |
| 30 | + "add_hook", |
| 31 | + "add_hook", |
| 32 | + "add_test", |
| 33 | + "add_test", |
| 34 | + "finish_describe_definition", |
| 35 | + "run_start", |
| 36 | + "run_describe_start", |
| 37 | + "run_describe_start", |
| 38 | + "test_start: passing test", |
| 39 | + "hook_start: beforeEach", |
| 40 | + "hook_success: beforeEach", |
| 41 | + "hook_start: beforeEach", |
| 42 | + "hook_success: beforeEach", |
| 43 | + "test_fn_start: passing test", |
| 44 | + "test_fn_success: passing test", |
| 45 | + "hook_start: afterEach", |
| 46 | + "hook_failure: afterEach", |
| 47 | + "test_done: passing test", |
| 48 | + "test_start: failing test", |
| 49 | + "hook_start: beforeEach", |
| 50 | + "hook_success: beforeEach", |
| 51 | + "hook_start: beforeEach", |
| 52 | + "hook_success: beforeEach", |
| 53 | + "test_fn_start: failing test", |
| 54 | + "test_fn_failure: failing test", |
| 55 | + "hook_start: afterEach", |
| 56 | + "hook_failure: afterEach", |
| 57 | + "test_done: failing test", |
| 58 | + "run_describe_finish", |
| 59 | + "run_describe_finish", |
| 60 | + "run_finish", |
| 61 | + "teardown", |
| 62 | + ] |
| 63 | + `); |
| 64 | +}); |
0 commit comments