-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
module: disable conditional exports, self resolve warnings
PR-URL: #31845 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
- Loading branch information
1 parent
04eda02
commit b9f3bfe
Showing
4 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import '../common/index.mjs'; | ||
import { path } from '../common/fixtures.mjs'; | ||
import { strictEqual, ok } from 'assert'; | ||
import { spawn } from 'child_process'; | ||
|
||
const child = spawn(process.execPath, [ | ||
'--experimental-import-meta-resolve', | ||
path('/es-modules/import-resolve-exports.mjs') | ||
]); | ||
|
||
let stderr = ''; | ||
child.stderr.setEncoding('utf8'); | ||
child.stderr.on('data', (data) => { | ||
stderr += data; | ||
}); | ||
child.on('close', (code, signal) => { | ||
strictEqual(code, 0); | ||
strictEqual(signal, null); | ||
ok(stderr.toString().includes( | ||
'ExperimentalWarning: The ESM module loader is experimental' | ||
)); | ||
ok(!stderr.toString().includes( | ||
'ExperimentalWarning: Conditional exports' | ||
)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { strictEqual } from 'assert'; | ||
|
||
(async () => { | ||
const resolved = await import.meta.resolve('pkgexports-sugar'); | ||
strictEqual(typeof resolved, 'string'); | ||
})() | ||
.catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |