Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2020-10-29 23:30:25 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2020-10-30 20:32:27 +0300
commit2a680e91a2be1f3f03a6fbd946f74628ee1cb370 (patch)
tree9a7f08e9fa6b6b73de370bd486e579c1224e8b5d /test/lib/ci.js
parent81d6ceef6947e46355eb3ddb05a73da50870dfc1 (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.js3
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()
}
}