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

birthday.js « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c818223fb51e5c6e5d795e902fe112ee8bfd0731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const t = require('tap')
const npm = {
  flatOptions: {
    yes: false,
    package: [],
  },
  commands: {
    exec: (args, cb) => {
      t.equal(npm.flatOptions.yes, true, 'should say yes')
      t.strictSame(npm.flatOptions.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)

let calledCb = false
birthday.exec([], () => calledCb = true)
t.equal(calledCb, true, 'called the callback')