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

Function makeDescribe

packages/jest-circus/src/utils.ts:41–61  ·  view source on GitHub ↗
(
  name: Circus.BlockName,
  parent?: Circus.DescribeBlock,
  mode?: Circus.BlockMode,
)

Source from the content-addressed store, hash-verified

39}
40
41export const makeDescribe = (
42 name: Circus.BlockName,
43 parent?: Circus.DescribeBlock,
44 mode?: Circus.BlockMode,
45): Circus.DescribeBlock => {
46 let _mode = mode;
47 if (parent && !mode) {
48 // If not set explicitly, inherit from the parent describe.
49 _mode = parent.mode;
50 }
51
52 return {
53 type: 'describeBlock', // eslint-disable-next-line sort-keys
54 children: [],
55 hooks: [],
56 mode: _mode,
57 name: convertDescriptorToString(name),
58 parent,
59 tests: [],
60 };
61};
62
63export const makeTest = (
64 fn: Circus.TestFn,

Callers 4

eventHandlerFunction · 0.90
createStateFunction · 0.90
makeFailedTestResultFunction · 0.90

Calls 1

Tested by 1

makeFailedTestResultFunction · 0.72