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
path: root/test
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2021-03-23 01:25:28 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-03-23 01:25:28 +0300
commit4fb6e2fd7fbbdb8791b4ccefe0433bd3cb62f0d5 (patch)
treef6d1c742e10a18922ceb78e05d9ae6e02546ab9a /test
parentb7b4491bf1d9df70149f48bca6557e55acf5cee6 (diff)
fix: npm birthday
Replaces usage of flatOptions with npm.config.
Diffstat (limited to 'test')
-rw-r--r--test/lib/birthday.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/lib/birthday.js b/test/lib/birthday.js
index c818223fb..0589be7a8 100644
--- a/test/lib/birthday.js
+++ b/test/lib/birthday.js
@@ -1,20 +1,23 @@
const t = require('tap')
-const npm = {
- flatOptions: {
- yes: false,
- package: [],
- },
+const mockNpm = require('../fixtures/mock-npm')
+
+const config = {
+ yes: false,
+ package: [],
+}
+const npm = mockNpm({
+ config,
commands: {
exec: (args, cb) => {
- t.equal(npm.flatOptions.yes, true, 'should say yes')
- t.strictSame(npm.flatOptions.package, ['@npmcli/npm-birthday'],
+ t.equal(npm.config.get('yes'), true, 'should say yes')
+ t.strictSame(npm.config.get('package'), ['@npmcli/npm-birthday'],
'uses correct package')
t.strictSame(args, ['npm-birthday'], 'called with correct args')
t.match(cb, Function, 'callback is a function')
cb()
},
},
-}
+})
const Birthday = require('../../lib/birthday.js')
const birthday = new Birthday(npm)