Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Upgrade): add scope flag to the upgrade command #3190

Merged
merged 7 commits into from
Apr 24, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(Upgrade): fix tests
  • Loading branch information
Joge97 committed Apr 21, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e297ec5dd46add16466888c68d812521c5cec22f
12 changes: 6 additions & 6 deletions __tests__/commands/upgrade.js
Original file line number Diff line number Diff line change
@@ -298,12 +298,12 @@ test.concurrent('respects --scope flag', (): Promise<void> => {
const lockfile = explodeLockfile(await fs.readFile(path.join(config.cwd, 'yarn.lock')));
const pkg = await fs.readJson(path.join(config.cwd, 'package.json'));

expect(lockfile.indexOf('@angular-mdl/core@^4.0.0:')).toBeGreaterThanOrEqual(0);
expect(lockfile.indexOf('@angular/core@^2.4.9:')).toEqual(-1);
expect(lockfile.indexOf('left-pad@^1.0.0:')).toBeGreaterThanOrEqual(0);
expect(lockfile.indexOf('@angular-mdl/core@4.0.0:')).toBeGreaterThanOrEqual(0);
expect(lockfile.indexOf('@angular/core@2.4.9:')).toEqual(-1);
expect(lockfile.indexOf('left-pad@1.0.0:')).toBeGreaterThanOrEqual(0);

expect(pkg.dependencies['@angular-mdl/core']).toEqual('^4.0.0');
expect(pkg.dependencies['@angular/core']).not.toEqual('^2.4.9');
expect(pkg.dependencies['left-pad']).toEqual('^1.0.0');
expect(pkg.dependencies['@angular-mdl/core']).toEqual('4.0.0');
expect(pkg.dependencies['@angular/core']).not.toEqual('2.4.9');
expect(pkg.dependencies['left-pad']).toEqual('1.0.0');
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a test to make sure that -S @angular doesn't upgrade @angular-whatever

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix the test issue and add this test case.

8 changes: 3 additions & 5 deletions __tests__/fixtures/upgrade/respects-scope-flag/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"dependencies": {
"@angular-mdl/core": "^4.0.0",
"@angular/core": "^2.4.9",
"left-pad": "^1.0.0",
"rxjs": "^5.0.1",
"zone.js": "^0.7.2"
"@angular-mdl/core": "4.0.0",
"@angular/core": "2.4.9",
"left-pad": "1.0.0"
}
}
32 changes: 9 additions & 23 deletions __tests__/fixtures/upgrade/respects-scope-flag/yarn.lock
Original file line number Diff line number Diff line change
@@ -2,28 +2,14 @@
# yarn lockfile v1


"@angular-mdl/core@^4.0.0":
version "4.0.3"
resolved "http://nexus.lan/repository/npm-public/@angular-mdl/core/-/core-4.0.3.tgz#9c52c8da1f8094db4d1b01d7d2faa366f6f35159"
"@angular-mdl/core@4.0.0":
version "4.0.0"
resolved "http://nexus.lan/repository/npm-public/@angular-mdl/core/-/core-4.0.0.tgz#9415a3340cbeeac01739e5777971fec307b13c17"

"@angular/core@^2.4.9":
version "2.4.10"
resolved "http://nexus.lan/repository/npm-public/@angular/core/-/core-2.4.10.tgz#0b8320a65065965d998645b1f5cd3cf769b441ea"
"@angular/core@2.4.9":
version "2.4.9"
resolved "http://nexus.lan/repository/npm-public/@angular/core/-/core-2.4.9.tgz#85dca2afa4021be91512c97597702ac8d73092e6"

left-pad@^1.0.0:
version "1.1.3"
resolved "http://nexus.lan/repository/npm-public/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"

rxjs@^5.0.1:
version "5.3.0"
resolved "http://nexus.lan/repository/npm-public/rxjs/-/rxjs-5.3.0.tgz#d88ccbdd46af290cbdb97d5d8055e52453fabe2d"
dependencies:
symbol-observable "^1.0.1"

symbol-observable@^1.0.1:
version "1.0.4"
resolved "http://nexus.lan/repository/npm-public/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"

zone.js@^0.7.2:
version "0.7.8"
resolved "http://nexus.lan/repository/npm-public/zone.js/-/zone.js-0.7.8.tgz#4f3fe8834d44597f2639053a0fa438df34fffded"
left-pad@1.0.0:
version "1.0.0"
resolved "http://nexus.lan/repository/npm-public/left-pad/-/left-pad-1.0.0.tgz#c84e2417581bbb8eaf2b9e3d7a122e572ab1af37"