/
testEnvironmentCircusAsync.test.ts
64 lines (60 loc) · 1.92 KB
/
testEnvironmentCircusAsync.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* 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.
*/
import {skipSuiteOnJasmine} from '@jest/test-utils';
import runJest from '../runJest';
skipSuiteOnJasmine();
it('calls asynchronous handleTestEvent in testEnvironment', () => {
const result = runJest('test-environment-circus-async');
expect(result.failed).toEqual(true);
const lines = result.stdout.split('\n');
expect(lines).toMatchInlineSnapshot(`
Array [
"setup",
"warning: add_hook is a sync event",
"warning: start_describe_definition is a sync event",
"warning: add_hook is a sync event",
"warning: add_hook is a sync event",
"warning: add_test is a sync event",
"warning: add_test is a sync event",
"warning: finish_describe_definition is a sync event",
"add_hook",
"start_describe_definition",
"add_hook",
"add_hook",
"add_test",
"add_test",
"finish_describe_definition",
"run_start",
"run_describe_start",
"run_describe_start",
"test_start: passing test",
"hook_start: beforeEach",
"hook_success: beforeEach",
"hook_start: beforeEach",
"hook_success: beforeEach",
"test_fn_start: passing test",
"test_fn_success: passing test",
"hook_start: afterEach",
"hook_failure: afterEach",
"test_done: passing test",
"test_start: failing test",
"hook_start: beforeEach",
"hook_success: beforeEach",
"hook_start: beforeEach",
"hook_success: beforeEach",
"test_fn_start: failing test",
"test_fn_failure: failing test",
"hook_start: afterEach",
"hook_failure: afterEach",
"test_done: failing test",
"run_describe_finish",
"run_describe_finish",
"run_finish",
"teardown",
]
`);
});