MCPcopy
hub / github.com/webpack/webpack / inSuite

Function inSuite

test/helpers/createLazyTestEnv.js:68–90  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

66 * @returns {void}
67 */
68 const inSuite = (fn) => {
69 const {
70 currentDescribeBlock: oldCurrentDescribeBlock,
71 currentlyRunningTest: oldCurrentlyRunningTest,
72 hasStarted: oldHasStarted
73 } = state;
74 state.currentDescribeBlock = currentDescribeBlock;
75 state.currentlyRunningTest = currentlyRunningTest;
76 state.hasStarted = false;
77 try {
78 fn();
79 } catch (err) {
80 /* eslint-disable no-unused-expressions */
81 // avoid leaking memory
82 /** @type {Error} */
83 (err).stack;
84 /* eslint-enable no-unused-expressions */
85 throw err;
86 }
87 state.currentDescribeBlock = oldCurrentDescribeBlock;
88 state.currentlyRunningTest = oldCurrentlyRunningTest;
89 state.hasStarted = oldHasStarted;
90 };
91 /**
92 * @param {import("@jest/types").Circus.TestEntry | import("@jest/types").Circus.Hook} block test or hook entry
93 * @returns {void}

Callers 3

itFunction · 0.85
beforeEachFunction · 0.85
afterEachFunction · 0.85

Calls 1

fnFunction · 0.50

Tested by 1

itFunction · 0.68