()
| 3065 | }; |
| 3066 | |
| 3067 | var runHook = function runHook() { |
| 3068 | if (hookName === "before") { |
| 3069 | if (hookOwner.unskippedTestsRun !== 0) { |
| 3070 | return; |
| 3071 | } |
| 3072 | |
| 3073 | _this2.preserveEnvironment = true; |
| 3074 | } |
| 3075 | |
| 3076 | // The 'after' hook should only execute when there are not tests left and |
| 3077 | // when the 'after' and 'finish' tasks are the only tasks left to process |
| 3078 | if (hookName === "after" && hookOwner.unskippedTestsRun !== numberOfUnskippedTests(hookOwner) - 1 && (config.queue.length > 0 || ProcessingQueue.taskCount() > 2)) { |
| 3079 | return; |
| 3080 | } |
| 3081 | |
| 3082 | config.current = _this2; |
| 3083 | if (config.notrycatch) { |
| 3084 | callHook(); |
| 3085 | return; |
| 3086 | } |
| 3087 | try { |
| 3088 | callHook(); |
| 3089 | } catch (error) { |
| 3090 | _this2.pushFailure(hookName + " failed on " + _this2.testName + ": " + (error.message || error), extractStacktrace(error, 0)); |
| 3091 | } |
| 3092 | }; |
| 3093 | |
| 3094 | return runHook; |
| 3095 | }, |
nothing calls this directly
no test coverage detected