Jelajahi Sumber

test(boot): use native path canonicalization

imccyu 2 minggu lalu
induk
melakukan
2fc699255f
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      packages/boot/app-boot/tests/profile-resolution.spec.ts

+ 2 - 2
packages/boot/app-boot/tests/profile-resolution.spec.ts

@@ -231,7 +231,7 @@ describe('profile resolution generation', { concurrent: false }, () => {
     const bundleChoice = generation.entries.find(entry => entry.name === 'bundle-choice')
     const bundleChoice = generation.entries.find(entry => entry.name === 'bundle-choice')
     if (bundleChoice === undefined) throw new Error('generation omitted bundle-choice')
     if (bundleChoice === undefined) throw new Error('generation omitted bundle-choice')
     expect(bundleChoice).toMatchObject({ scope: 'profile' })
     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({
     expect(generation.entries.find(entry => entry.name === 'peer-choice')).toMatchObject({
       packageDir: peerChoice,
       packageDir: peerChoice,
       scope: 'installation',
       scope: 'installation',
@@ -484,7 +484,7 @@ describe('profile resolution generation', { concurrent: false }, () => {
     const resolvedBundleOnly = createRequire(other).resolve('bundle-only', {
     const resolvedBundleOnly = createRequire(other).resolve('bundle-only', {
       paths: [dirname(other), f.profile.dir],
       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)] }))
     expect(() => createRequire(other).resolve('bundle-only', { paths: [dirname(other)] }))
       .toThrow(/Cannot find module/u)
       .toThrow(/Cannot find module/u)
     expect(() => createRequire(other).resolve('missing-explicit', { paths: [dirname(other)] }))
     expect(() => createRequire(other).resolve('missing-explicit', { paths: [dirname(other)] }))