| 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} |