Skip to content

Commit

Permalink
added failing unit test for yarnpkg#2165
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Zins committed Jan 13, 2017
1 parent e48cd2a commit 6c9d297
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
20 changes: 20 additions & 0 deletions __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,26 @@ test.concurrent('install file: protocol with relative paths', (): Promise<void>
});
});

test.concurrent('install file: protocol without cache', async (): Promise<void> => {
const fixturesLoc = path.join(__dirname, '..', '..', 'fixtures', 'install');
const compLoc = path.join(fixturesLoc, 'install-file-without-cache', 'comp', 'index.js');

return fs.writeFile(compLoc,'foo\n').then(() =>
runInstall({noLockfile: true}, 'install-file-without-cache', async (config) => {
assert.equal(
await fs.readFile(path.join(config.cwd, 'node_modules', 'comp', 'index.js')),
'foo\n',
);
await fs.writeFile(compLoc, 'bar\n');
await runInstall({noLockfile: true}, 'install-file-without-cache');
assert.equal(
await fs.readFile(path.join(config.cwd, 'node_modules', 'comp', 'index.js')),
'bar\n',
);
})
);
});

test.concurrent('install file: protocol', (): Promise<void> => {
return runInstall({noLockfile: true}, 'install-file', async (config) => {
assert.equal(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# this file will be generated
index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "comp",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"comp": "file:comp"
}
}

0 comments on commit 6c9d297

Please sign in to comment.