diff --git a/__tests__/commands/install/integration.js b/__tests__/commands/install/integration.js index 4106128210..8e47bd703d 100644 --- a/__tests__/commands/install/integration.js +++ b/__tests__/commands/install/integration.js @@ -212,6 +212,26 @@ test.concurrent('install file: protocol with relative paths', (): Promise }); }); +test.concurrent('install file: protocol without cache', async (): Promise => { + 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 => { return runInstall({noLockfile: true}, 'install-file', async (config) => { assert.equal( diff --git a/__tests__/fixtures/install/install-file-without-cache/comp/.gitignore b/__tests__/fixtures/install/install-file-without-cache/comp/.gitignore new file mode 100644 index 0000000000..9d8a81a138 --- /dev/null +++ b/__tests__/fixtures/install/install-file-without-cache/comp/.gitignore @@ -0,0 +1,2 @@ +# this file will be generated +index.js diff --git a/__tests__/fixtures/install/install-file-without-cache/comp/package.json b/__tests__/fixtures/install/install-file-without-cache/comp/package.json new file mode 100644 index 0000000000..c7af479c50 --- /dev/null +++ b/__tests__/fixtures/install/install-file-without-cache/comp/package.json @@ -0,0 +1,4 @@ +{ + "name": "comp", + "version": "1.0.0" +} diff --git a/__tests__/fixtures/install/install-file-without-cache/package.json b/__tests__/fixtures/install/install-file-without-cache/package.json new file mode 100644 index 0000000000..478addfb42 --- /dev/null +++ b/__tests__/fixtures/install/install-file-without-cache/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "comp": "file:comp" + } +}