diff options
author | nlf <quitlahok@gmail.com> | 2020-10-29 23:30:25 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-10-30 20:32:27 +0300 |
commit | 2a680e91a2be1f3f03a6fbd946f74628ee1cb370 (patch) | |
tree | 9a7f08e9fa6b6b73de370bd486e579c1224e8b5d /test/lib/ci.js | |
parent | 81d6ceef6947e46355eb3ddb05a73da50870dfc1 (diff) |
delete the contents of node_modules only
PR-URL: https://github.com/npm/cli/pull/2083
Credit: @nlf
Close: #2083
Reviewed-by: @darcyclarke
Diffstat (limited to 'test/lib/ci.js')
-rw-r--r-- | test/lib/ci.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lib/ci.js b/test/lib/ci.js index 3c642ba93..645fc6aed 100644 --- a/test/lib/ci.js +++ b/test/lib/ci.js @@ -104,7 +104,8 @@ test('should remove existing node_modules before installing', (t) => { t.equal(options.save, false, 'npm ci should never save') // check if node_modules was removed before reifying const contents = await readdir(testDir) - t.equals(contents.indexOf('node_modules'), -1, 'node_modules does not exist') + const nodeModules = contents.filter((path) => path.startsWith('node_modules')) + t.same(nodeModules, ['node_modules'], 'should only have the node_modules directory') t.end() } } |