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/commands/birthday.js')
-rw-r--r--test/lib/commands/birthday.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/lib/commands/birthday.js b/test/lib/commands/birthday.js
new file mode 100644
index 000000000..c92f197c5
--- /dev/null
+++ b/test/lib/commands/birthday.js
@@ -0,0 +1,28 @@
+const t = require('tap')
+const { fake: mockNpm } = require('../../fixtures/mock-npm')
+
+t.test('birthday', async t => {
+ t.plan(4)
+ const config = {
+ yes: false,
+ package: [],
+ }
+ const npm = mockNpm({
+ config,
+ cmd: async (cmd) => {
+ t.ok(cmd, 'exec', 'calls out to exec command')
+ return {
+ exec: async (args) => {
+ 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')
+ },
+ }
+ },
+ })
+ const Birthday = require('../../../lib/commands/birthday.js')
+ const birthday = new Birthday(npm)
+
+ await birthday.exec([])
+})