Skip to content

Commit

Permalink
test(integration): Adds assertion to exemplify wrong path resolution …
Browse files Browse the repository at this point in the history
…in lock file

The added assertions make sure that the relative path generated in the lock file points to the
installation, not the yarn cache

#4388
  • Loading branch information
joscha committed Feb 27, 2018
1 parent dd1bf7c commit c0ec6eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ test.concurrent('root install with optional deps', (): Promise<void> => {
test.concurrent('install file: protocol with relative paths', (): Promise<void> => {
return runInstall({}, 'install-file-relative', async config => {
expect(await fs.readFile(path.join(config.cwd, 'node_modules', 'root-a', 'index.js'))).toEqual('foobar;\n');

const lockFileContent = await fs.readFile(path.join(config.cwd, 'yarn.lock'));
const lockFileLines = explodeLockfile(lockFileContent);
expect(lockFileLines[5]).toMatch('"file:../root-a"');
expect(lockFileLines[9]).toMatch('"file:../../root-b"');
});
});

Expand Down

0 comments on commit c0ec6eb

Please sign in to comment.