(context, code, identifier, testFile, moduleCache)
| 663 | }; |
| 664 | |
| 665 | const runModule = async (context, code, identifier, testFile, moduleCache) => { |
| 666 | const module = new vm.SourceTextModule(code, { |
| 667 | context, |
| 668 | identifier, |
| 669 | importModuleDynamically: createImportModuleDynamically( |
| 670 | context, |
| 671 | testFile, |
| 672 | moduleCache |
| 673 | ), |
| 674 | initializeImportMeta: (meta) => { |
| 675 | meta.url = url.pathToFileURL(identifier).toString(); |
| 676 | } |
| 677 | }); |
| 678 | |
| 679 | await module.link(async () => {}); |
| 680 | await module.evaluate(); |
| 681 | |
| 682 | return module; |
| 683 | }; |
| 684 | |
| 685 | const runScript = async ( |
| 686 | context, |
no test coverage detected