This repository has been archived by the owner on May 14, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: try to preserve subdependencies of updated packages
- Loading branch information
Showing
5 changed files
with
369 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ import './global' | |
import './independentLeaves' | ||
import './store' | ||
import './reporting' | ||
import './update' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import tape = require('tape') | ||
import promisifyTape from 'tape-promise' | ||
import { | ||
prepare, | ||
addDistTag, | ||
testDefaults, | ||
} from '../utils' | ||
import {install, installPkgs} from '../../src' | ||
|
||
const test = promisifyTape(tape) | ||
|
||
test('preserve subdeps on update', async (t: tape.Test) => { | ||
const project = prepare(t) | ||
|
||
await Promise.all([ | ||
addDistTag('foobarqar', '1.0.0', 'latest'), | ||
addDistTag('foo', '100.0.0', 'latest'), | ||
addDistTag('bar', '100.0.0', 'latest'), | ||
]) | ||
|
||
await installPkgs(['foobarqar'], testDefaults()) | ||
|
||
await Promise.all([ | ||
addDistTag('foobarqar', '1.0.1', 'latest'), | ||
addDistTag('foo', '100.1.0', 'latest'), | ||
addDistTag('bar', '100.1.0', 'latest'), | ||
]) | ||
|
||
await install(testDefaults({update: true, depth: 0})) | ||
|
||
const shr = await project.loadShrinkwrap() | ||
|
||
t.ok(shr.packages) | ||
t.ok(shr.packages['/foobarqar/1.0.1']) | ||
t.deepEqual(shr.packages['/foobarqar/1.0.1'].dependencies, { | ||
bar: '100.0.0', | ||
foo: '100.0.0', | ||
qar: '100.0.0', | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.