Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Nov 5, 2023
1 parent e84e8c2 commit 7fcb9f5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/get-context/get-context.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({})();
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 7fcb9f5

Please sign in to comment.