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:
Diffstat (limited to 'test/lib/outdated.js')
-rw-r--r--test/lib/outdated.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lib/outdated.js b/test/lib/outdated.js
index 518436d0a..acd5c25e8 100644
--- a/test/lib/outdated.js
+++ b/test/lib/outdated.js
@@ -83,6 +83,10 @@ const globalDir = t.testdir({
},
})
+const flatOptions = {
+ workspacesEnabled: true,
+}
+
const outdated = (dir, opts) => {
logs = ''
const Outdated = t.mock('../../lib/outdated.js', {
@@ -94,6 +98,7 @@ const outdated = (dir, opts) => {
...opts,
localPrefix: dir,
prefix: dir,
+ flatOptions,
globalDir: `${globalDir}/node_modules`,
output,
})
@@ -562,6 +567,21 @@ t.test('workspaces', async t => {
})
await new Promise((res, rej) => {
+ flatOptions.workspacesEnabled = false
+ outdated(testDir, {}).exec([], err => {
+ if (err)
+ rej(err)
+
+ // TODO: This should display dog, but doesn't because arborist filters
+ // workspace deps even if they're also root deps
+ // This will be fixed in a future arborist version
+ t.matchSnapshot(logs, 'should display only root outdated when ws disabled')
+ flatOptions.workspacesEnabled = true
+ res()
+ })
+ })
+
+ await new Promise((res, rej) => {
outdated(testDir, {
config: {
json: true,