Skip to content

Commit 7c11e8e

Browse files
committed
fix path issues on test
1 parent 555d34c commit 7c11e8e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/container.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,21 +899,23 @@ async function loadSupportObject(modulePath, supportObjectName) {
899899

900900
let obj
901901
try {
902-
obj = await import(importPath)
902+
const resolvedImportPath =
903+
isWindows() && typeof importPath === 'string' && path.isAbsolute(importPath)
904+
? pathToFileURL(importPath).href
905+
: importPath
906+
907+
obj = await import(resolvedImportPath)
903908
} catch (importError) {
904-
// Fix error stack to point to original .ts files
905909
if (fileMapping) {
906910
fixErrorStack(importError, fileMapping)
907911
}
908912

909-
// Clean up temp files if created before rethrowing
910913
if (tempJsFile) {
911914
const filesToClean = Array.isArray(tempJsFile) ? tempJsFile : [tempJsFile]
912915
cleanupTempFiles(filesToClean)
913916
}
914917
throw importError
915918
} finally {
916-
// Clean up temp files if created
917919
if (tempJsFile) {
918920
const filesToClean = Array.isArray(tempJsFile) ? tempJsFile : [tempJsFile]
919921
cleanupTempFiles(filesToClean)

0 commit comments

Comments
 (0)