/
types.ts
32 lines (29 loc) · 897 Bytes
/
types.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
/**
* 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.
*/
// Used as type
import type {Circus} from '@jest/types';
import type expect = require('expect');
export const STATE_SYM = (Symbol(
'JEST_STATE_SYMBOL',
) as unknown) as 'STATE_SYM_SYMBOL';
export const RETRY_TIMES = (Symbol.for(
'RETRY_TIMES',
) as unknown) as 'RETRY_TIMES_SYMBOL';
// To pass this value from Runtime object to state we need to use global[sym]
export const TEST_TIMEOUT_SYMBOL = (Symbol.for(
'TEST_TIMEOUT_SYMBOL',
) as unknown) as 'TEST_TIMEOUT_SYMBOL';
declare global {
module NodeJS {
interface Global {
STATE_SYM_SYMBOL: Circus.State;
RETRY_TIMES_SYMBOL: string;
TEST_TIMEOUT_SYMBOL: number;
expect: typeof expect;
}
}
}