Commit 4528d9a
Fix test_locate_file_abspath_esm to use dynamic import for path module
The test was using require('path') which doesn't work in ESM mode.
Since ESM output (.mjs) wraps the module in an async context, we can
use top-level await with dynamic import.
Changed from:
require('path')['isAbsolute'](scriptDirectory)
To:
var nodePath = await import('node:path');
nodePath.isAbsolute(scriptDirectory)
This properly tests the Node.js path.isAbsolute() function while being
compatible with ESM module format. The CJS variant (test_locate_file_abspath)
continues to use require() as appropriate for CommonJS.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 3474523 commit 4528d9a
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15081 | 15081 | | |
15082 | 15082 | | |
15083 | 15083 | | |
| 15084 | + | |
15084 | 15085 | | |
| 15086 | + | |
15085 | 15087 | | |
15086 | | - | |
| 15088 | + | |
15087 | 15089 | | |
15088 | 15090 | | |
15089 | 15091 | | |
| |||
0 commit comments