Skip to content

Commit

Permalink
Fixes unwanted yarn.lock optimization issue #3490 (#3729)
Browse files Browse the repository at this point in the history
* Resolves non-fresh-packages with the exact version specified in the lockfile if possible, fixes #3490

* Adds a test
  • Loading branch information
arcanis authored Jun 27, 2017
1 parent a7e6efe commit 5152bd7
Show file tree
Hide file tree
Showing 22 changed files with 1,391 additions and 4 deletions.
9 changes: 9 additions & 0 deletions __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ test.concurrent('properly find and save build artifacts', async () => {
});
});

test('reading a lockfile should not optimize it', async () => {
await runInstall({}, 'lockfile-optimization', async (config, reporter): Promise<void> => {
const was = await fs.readFile(`${__dirname}/../../fixtures/install/lockfile-optimization/yarn.lock`);
const is = await fs.readFile(`${config.cwd}/yarn.lock`);

expect(is).toEqual(was);
});
});

test('creates the file in the mirror when fetching a git repository', async () => {
await runInstall({}, 'install-git', async (config, reporter): Promise<void> => {
const lockfile = await Lockfile.fromDirectory(config.cwd);
Expand Down
6 changes: 6 additions & 0 deletions __tests__/fixtures/install/lockfile-optimization/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"webpack": "1.14.0",
"webpack-parallel-uglify-plugin": "0.2.0"
}
}
Loading

0 comments on commit 5152bd7

Please sign in to comment.