(globalSetupPath, cwd)
| 705 | } |
| 706 | |
| 707 | async function setupGlobalSetupTeardownFunctions(globalSetupPath, cwd) { |
| 708 | let globalSetupFunction; |
| 709 | let globalTeardownFunction; |
| 710 | if (globalSetupPath) { |
| 711 | validatePath(globalSetupPath, 'options.globalSetupPath'); |
| 712 | const fileURL = pathToFileURL(resolve(cwd, globalSetupPath)); |
| 713 | const cascadedLoader = require('internal/modules/esm/loader').getOrInitializeCascadedLoader(); |
| 714 | const globalSetupModule = await cascadedLoader |
| 715 | .import(fileURL, pathToFileURL(cwd + sep).href, kEmptyObject); |
| 716 | if (globalSetupModule.globalSetup) { |
| 717 | validateFunction(globalSetupModule.globalSetup, 'globalSetupModule.globalSetup'); |
| 718 | globalSetupFunction = globalSetupModule.globalSetup; |
| 719 | } |
| 720 | if (globalSetupModule.globalTeardown) { |
| 721 | validateFunction(globalSetupModule.globalTeardown, 'globalSetupModule.globalTeardown'); |
| 722 | globalTeardownFunction = globalSetupModule.globalTeardown; |
| 723 | } |
| 724 | } |
| 725 | return { __proto__: null, globalSetupFunction, globalTeardownFunction }; |
| 726 | } |
| 727 | |
| 728 | module.exports = { |
| 729 | convertStringToRegExp, |
no test coverage detected
searching dependent graphs…