Skip to content

Commit

Permalink
test: add test for yarn add --dev --peer usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jj811208 committed Aug 27, 2022
1 parent 65e1261 commit de54cb6
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,22 @@ describe(`Commands`, () => {
}),
);

test(
`it should add a new peer dependency and a new development dependency to the current project when using --peer and --dev together`,
makeTemporaryEnv({}, async ({path, run, source}) => {
await run(`add`, `no-deps`, `-D`, `-P`);

await expect(xfs.readJsonPromise(ppath.join(path, Filename.manifest))).resolves.toMatchObject({
devDependencies: {
[`no-deps`]: `^2.0.0`,
},
peerDependencies: {
[`no-deps`]: `*`,
},
});
}),
);

test(
`it should add a node-gyp dependency to the lockfile if a script uses it`,
makeTemporaryEnv({}, async ({path, run, source}) => {
Expand Down

0 comments on commit de54cb6

Please sign in to comment.