forked from yarnpkg/yarn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue yarnpkg#570 Make install pure by default
- Loading branch information
Showing
5 changed files
with
26 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,14 +49,18 @@ test.concurrent('flat arg is inherited from root manifest', async (): Promise<vo | |
|
||
|
||
test.concurrent("doesn't write new lockfile if existing one satisfied", (): Promise<void> => { | ||
return runInstall({}, 'install-dont-write-lockfile-if-satisfied', async (config): Promise<void> => { | ||
const lockfile = await fs.readFile(path.join(config.cwd, 'yarn.lock')); | ||
assert(lockfile.indexOf('foobar') >= 0); | ||
}); | ||
return runInstall( | ||
{writeLockfile: true}, | ||
'install-dont-write-lockfile-if-satisfied', | ||
async (config): Promise<void> => { | ||
const lockfile = await fs.readFile(path.join(config.cwd, 'yarn.lock')); | ||
assert(lockfile.indexOf('foobar') >= 0); | ||
}, | ||
); | ||
}); | ||
|
||
test.concurrent("writes new lockfile if existing one isn't satisfied", async (): Promise<void> => { | ||
await runInstall({}, 'install-write-lockfile-if-not-satisfied', async (config): Promise<void> => { | ||
await runInstall({writeLockfile: true}, 'install-write-lockfile-if-not-satisfied', async (config): Promise<void> => { | ||
const lockfile = await fs.readFile(path.join(config.cwd, 'yarn.lock')); | ||
assert(lockfile.indexOf('foobar') === -1); | ||
}); | ||
|
@@ -393,7 +397,7 @@ test.concurrent( | |
(): Promise<void> => { | ||
const mirrorPath = 'mirror-for-offline'; | ||
|
||
return runInstall({}, 'uninstall-should-clean', async (config, reporter) => { | ||
return runInstall({writeLockfile: true}, 'uninstall-should-clean', async (config, reporter) => { | ||
assert.equal( | ||
await getPackageVersion(config, 'dep-a'), | ||
'1.0.0', | ||
|
@@ -557,9 +561,9 @@ test.concurrent('install should resolve circular dependencies 2', (): Promise<vo | |
}); | ||
|
||
test.concurrent( | ||
'install should add missing deps to yarn and mirror (PR import scenario)', | ||
'install should add missing deps to yarn and mirror when given --write-lockfile (PR import scenario)', | ||
(): Promise<void> => { | ||
return runInstall({}, 'install-import-pr', async (config) => { | ||
return runInstall({writeLockfile: true}, 'install-import-pr', async (config) => { | ||
assert.equal(await getPackageVersion(config, 'mime-types'), '2.0.0'); | ||
assert(semver.satisfies(await getPackageVersion(config, 'mime-db'), '~1.0.1')); | ||
assert.equal(await getPackageVersion(config, 'fake-yarn-dependency'), '1.0.1'); | ||
|
@@ -579,7 +583,6 @@ test.concurrent( | |
}, | ||
); | ||
|
||
|
||
xit('install should update a dependency to yarn and mirror (PR import scenario 2)', (): Promise<void> => { | ||
// [email protected] is saved in local mirror and gets updated to [email protected] via | ||
// a change in package.json, | ||
|
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
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