From a663bbf4b8da1b6083ea23357a727e9fcd89f0f4 Mon Sep 17 00:00:00 2001 From: imccyu Date: Mon, 14 Sep 2026 03:23:56 +0800 Subject: [PATCH] test(boot): canonicalize Windows resolver paths --- .../boot/app-boot/tests/profile-resolution.spec.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/boot/app-boot/tests/profile-resolution.spec.ts b/packages/boot/app-boot/tests/profile-resolution.spec.ts index 8a3db42ff8..2b8c737777 100644 --- a/packages/boot/app-boot/tests/profile-resolution.spec.ts +++ b/packages/boot/app-boot/tests/profile-resolution.spec.ts @@ -228,10 +228,10 @@ describe('profile resolution generation', { concurrent: false }, () => { packageDir: installationChoice, scope: 'installation', }) - expect(generation.entries.find(entry => entry.name === 'bundle-choice')).toMatchObject({ - packageDir: realpathSync(firstBundleChoice), - scope: 'profile', - }) + 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(generation.entries.find(entry => entry.name === 'peer-choice')).toMatchObject({ packageDir: peerChoice, scope: 'installation', @@ -481,9 +481,10 @@ describe('profile resolution generation', { concurrent: false }, () => { expect(createRequire(join(f.profile.dir, 'entry.cjs'))('bundle-only')).toEqual({ marker: 4 }) const other = join(f.root, 'profiles', 'other', 'entry.cjs') expect(() => { createRequire(other)('bundle-only') }).toThrow(/Cannot find module/u) - expect(createRequire(other).resolve('bundle-only', { + const resolvedBundleOnly = createRequire(other).resolve('bundle-only', { paths: [dirname(other), f.profile.dir], - })).toBe(join(bundleOnly, 'index.cjs')) + }) + expect(realpathSync(resolvedBundleOnly)).toBe(realpathSync(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)] }))