From 7fcb9f5bc2e3060f1b826842bb852b6d4bfbbd1f Mon Sep 17 00:00:00 2001 From: Jamie Mason Date: Sun, 5 Nov 2023 16:31:44 +0000 Subject: [PATCH] [WIP] --- src/get-context/get-context.spec.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/get-context/get-context.spec.ts b/src/get-context/get-context.spec.ts index 43dda9df..dd8ac15a 100644 --- a/src/get-context/get-context.spec.ts +++ b/src/get-context/get-context.spec.ts @@ -7,6 +7,7 @@ import { shape } from '../../test/lib/matchers'; import { DEFAULT_CONFIG } from '../constants'; import { NoSourcesFoundError } from '../get-package-json-files/get-file-paths'; import { JsonParseError } from '../io/read-json-file-sync'; +import { normalize } from 'path'; it('errors when no package.json is found', () => { const scenario = createScenario({})(); @@ -55,7 +56,7 @@ it('uses empty config and default sources when no user config is found', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'packages/bar/package.json', + shortPath: normalize('packages/bar/package.json'), }), ]); expect(ctx).toEqual( @@ -87,7 +88,7 @@ describe('finds package.json files', () => { }); expect(ctx).toHaveProperty('packageJsonFiles', [ shape.PackageJsonFile({ - shortPath: 'apps/bar/package.json', + shortPath: normalize('apps/bar/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -122,7 +123,7 @@ describe('finds package.json files', () => { }); expect(ctx).toHaveProperty('packageJsonFiles', [ shape.PackageJsonFile({ - shortPath: 'apps/baz/package.json', + shortPath: normalize('apps/baz/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -150,7 +151,7 @@ describe('finds package.json files', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'apps/bar/package.json', + shortPath: normalize('apps/bar/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -177,7 +178,7 @@ describe('finds package.json files', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'apps/bar/package.json', + shortPath: normalize('apps/bar/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -206,7 +207,7 @@ describe('finds package.json files', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'apps/bar/package.json', + shortPath: normalize('apps/bar/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -245,7 +246,7 @@ describe('finds package.json files', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'components/baz/package.json', + shortPath: normalize('components/baz/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -272,7 +273,7 @@ describe('finds package.json files', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'packages/bar/package.json', + shortPath: normalize('packages/bar/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object)); @@ -301,7 +302,7 @@ describe('finds package.json files', () => { shortPath: 'package.json', }), shape.PackageJsonFile({ - shortPath: 'packages/bar/package.json', + shortPath: normalize('packages/bar/package.json'), }), ]); expect(ctx).toHaveProperty('packageJsonFilesByName', expect.any(Object));