test(boot): use native path canonicalization

This commit is contained in:
imccyu authored and imccyu committed 2026-09-14 22:30:49 +08:00
1 parent a663bbf4b8
commit 2fc699255f
1 file changed
+2 -2
@@ -231,7 +231,7 @@ describe('profile resolution generation', { concurrent: false }, () => {
const bundleChoice = generation.entries.find(entry => entry.name === 'bundle-choice')
if (bundleChoice === undefined) throw new Error('generation omitted bundle-choice')
expect(bundleChoice).toMatchObject({ scope: 'profile' })
expect(realpathSync(bundleChoice.packageDir)).toBe(realpathSync(firstBundleChoice))
expect(realpathSync.native(bundleChoice.packageDir)).toBe(realpathSync.native(firstBundleChoice))
expect(generation.entries.find(entry => entry.name === 'peer-choice')).toMatchObject({
packageDir: peerChoice,
scope: 'installation',
@@ -484,7 +484,7 @@ describe('profile resolution generation', { concurrent: false }, () => {
const resolvedBundleOnly = createRequire(other).resolve('bundle-only', {
paths: [dirname(other), f.profile.dir],
})
expect(realpathSync(resolvedBundleOnly)).toBe(realpathSync(join(bundleOnly, 'index.cjs')))
expect(realpathSync.native(resolvedBundleOnly)).toBe(realpathSync.native(join(bundleOnly, 'index.cjs')))
expect(() => createRequire(other).resolve('bundle-only', { paths: [dirname(other)] }))
.toThrow(/Cannot find module/u)
expect(() => createRequire(other).resolve('missing-explicit', { paths: [dirname(other)] }))