Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/47902e08.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
Expand Up @@ -2,6 +2,40 @@ import {Filename, ppath, xfs} from '@yarnpkg/fslib';

describe(`Commands`, () => {
describe(`up`, () => {
test(
`it should bump dependency ranges to their latest`,
makeTemporaryEnv({
dependencies: {
[`no-deps`]: `^1.0.0`,
},
}, async ({path, run, source}) => {
await run(`up`, `no-deps`);

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

test(
`it shouldn't do anything when the dependency is already the latest`,
makeTemporaryEnv({
dependencies: {
[`no-deps`]: `^2.0.0`,
},
}, async ({path, run, source}) => {
await run(`up`, `no-deps`);

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

test(
`it should upgrade all dependencies matching a glob pattern (scope & star)`,
makeTemporaryEnv({
Expand Down
4 changes: 3 additions & 1 deletion packages/plugin-essentials/sources/commands/up.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ export default class UpCommand extends BaseCommand {
} else {
const resolver = configuration.makeResolver();
const resolveOptions: MinimalResolveOptions = {project, resolver};
const bound = resolver.bindDescriptor(current, workspace.anchoredLocator, resolveOptions);

const normalizedDependency = configuration.normalizeDependency(current);
const bound = resolver.bindDescriptor(normalizedDependency, workspace.anchoredLocator, resolveOptions);

project.forgetResolution(bound);
}
Expand Down