Skip to content

Commit 6b00c65

Browse files
committed
Adds a json lockfile feature check
1 parent 875d3b4 commit 6b00c65

File tree

2 files changed

+15
-2
lines changed
  • packages/acceptance-tests

2 files changed

+15
-2
lines changed

packages/acceptance-tests/pkg-tests-core/sources/utils/tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function isAtLeastMajor(major: number) {
3636
}
3737

3838
export const FEATURE_CHECKS = {
39+
jsonLockfile: isAtLeastMajor(5),
3940
prologConstraints: !isAtLeastMajor(5),
4041
} as const;
4142

packages/acceptance-tests/pkg-tests-specs/sources/commands/add.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,25 @@ describe(`Commands`, () => {
351351
const content = await xfs.readFilePromise(`${path}/yarn.lock` as PortablePath, `utf8`);
352352
const lock = parseSyml(content);
353353

354-
expect(lock).toMatchObject({
354+
const expectedLockfile = tests.FEATURE_CHECKS.jsonLockfile ? {
355+
entries: {
356+
[`inject-node-gyp@npm:^1.0.0`]: {
357+
resolution: {
358+
dependencies: {
359+
[`node-gyp`]: `*`,
360+
},
361+
},
362+
},
363+
},
364+
} : {
355365
[`inject-node-gyp@npm:^1.0.0`]: {
356366
dependencies: {
357367
[`node-gyp`]: `npm:latest`,
358368
},
359369
},
360-
});
370+
};
371+
372+
expect(lock).toMatchObject(expectedLockfile);
361373
}),
362374
);
363375

0 commit comments

Comments
 (0)