mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Signed-off-by: Mael Nison <nison.mael@gmail.com> PR-URL: https://github.com/nodejs/node/pull/62239 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
20 lines
746 B
JavaScript
20 lines
746 B
JavaScript
// Test that the same bare specifier resolves to different packages depending on the importer.
|
|
import '../common/index.mjs';
|
|
import assert from 'node:assert';
|
|
import { spawnSyncAndAssert } from '../common/child_process.js';
|
|
import * as fixtures from '../common/fixtures.mjs';
|
|
|
|
spawnSyncAndAssert(process.execPath, [
|
|
'--no-warnings',
|
|
'--experimental-package-map',
|
|
fixtures.path('package-map/package-map-version-fork.json'),
|
|
'--input-type=module',
|
|
'--eval',
|
|
`import app18 from 'app-18'; import app19 from 'app-19'; console.log(app18); console.log(app19);`,
|
|
], { cwd: fixtures.path('package-map/root') }, {
|
|
stdout(output) {
|
|
assert.match(output, /app-18 using react 18/);
|
|
assert.match(output, /app-19 using react 19/);
|
|
},
|
|
});
|