Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .yarn/versions/5ee1a872.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-essentials": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Commands up it should skip build scripts when using --mode=skip-build (recursive) 1`] = `
"➤ YN0000: · Yarn 0.0.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + no-deps-scripted@npm:1.0.0
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ A package was added to the cache (+ 2.07 KiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done
"
`;

exports[`Commands up it should skip build scripts when using --mode=skip-build 1`] = `
"➤ YN0000: · Yarn 0.0.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + no-deps-scripted@npm:1.0.0
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ A package was added to the cache (+ 2.07 KiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(`Commands`, () => {
}, async ({path, run, source}) => {
const {stdout} = await run(`install`, `--inline-builds`, `--mode=skip-build`);

await expect(stdout).toMatchSnapshot();
expect(stdout).toMatchSnapshot();
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe(`Commands`, () => {
[`no-deps`]: `1.0.0`,
},
}, async ({path, run, source}) => {
await run(`add`, `-F`, `no-deps@latest`);
await run(`up`, `-F`, `no-deps@latest`);

await expect(xfs.readJsonPromise(ppath.join(path, Filename.manifest))).resolves.toMatchObject({
dependencies: {
Expand All @@ -128,5 +128,41 @@ describe(`Commands`, () => {
});
}),
);

test(
`it should skip build scripts when using --mode=skip-build`,
makeTemporaryEnv({
dependencies: {
[`no-deps-scripted`]: `1.0.0`,
},
}, async ({path, run, source}) => {
const {stdout} = await run(`up`, `no-deps-scripted`, `--mode=skip-build`, {
env: {
YARN_ENABLE_INLINE_BUILDS: `1`,
},
});

expect(stdout).not.toContain(`must be built`);
expect(stdout).toMatchSnapshot();
}),
);

test(
`it should skip build scripts when using --mode=skip-build (recursive)`,
makeTemporaryEnv({
dependencies: {
[`no-deps-scripted`]: `1.0.0`,
},
}, async ({path, run, source}) => {
const {stdout} = await run(`up`, `no-deps-scripted`, `--recursive`, `--mode=skip-build`, {
env: {
YARN_ENABLE_INLINE_BUILDS: `1`,
},
});

expect(stdout).not.toContain(`must be built`);
expect(stdout).toMatchSnapshot();
}),
);
});
});
1 change: 1 addition & 0 deletions packages/plugin-essentials/sources/commands/up.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default class UpCommand extends BaseCommand {
stdout: this.context.stdout,
}, {
cache,
mode: this.mode,
});
}

Expand Down