MCPcopy
hub / github.com/jestjs/jest / createState

Function createState

packages/jest-circus/src/state.ts:22–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20export const ROOT_DESCRIBE_BLOCK_NAME = 'ROOT_DESCRIBE_BLOCK';
21
22const createState = (): Circus.State => {
23 const ROOT_DESCRIBE_BLOCK = makeDescribe(ROOT_DESCRIBE_BLOCK_NAME);
24 return {
25 currentDescribeBlock: ROOT_DESCRIBE_BLOCK,
26 currentlyRunningTest: null,
27 expand: undefined,
28 hasFocusedTests: false,
29 hasStarted: false,
30 includeTestLocationInResult: false,
31 maxConcurrency: 5,
32 parentProcess: null,
33 rootDescribeBlock: ROOT_DESCRIBE_BLOCK,
34 seed: 0,
35 testNamePattern: null,
36 testTimeout: 5000,
37 unhandledErrors: [],
38 unhandledRejectionErrorByPromise: new Map(),
39 };
40};
41
42export const getState = (): Circus.State =>
43 (globalThis as Global.Global)[STATE_SYM] as Circus.State;

Callers 1

resetStateFunction · 0.85

Calls 1

makeDescribeFunction · 0.90

Tested by

no test coverage detected