2021-03-04 17:40:28 -05:00
|
|
|
const t = require('tap')
|
2023-01-16 22:38:23 -05:00
|
|
|
const tmock = require('../../fixtures/tmock')
|
2021-03-04 17:40:28 -05:00
|
|
|
|
|
|
|
t.test('ll', t => {
|
|
|
|
t.plan(3)
|
|
|
|
|
|
|
|
class LS {
|
|
|
|
constructor (npm) {
|
|
|
|
this.npm = npm
|
|
|
|
}
|
|
|
|
|
2021-11-04 20:42:47 +00:00
|
|
|
async exec (args) {
|
2021-04-15 21:53:45 -04:00
|
|
|
t.same(args, ['pkg'], 'should forward args')
|
2021-03-04 17:40:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-16 22:38:23 -05:00
|
|
|
const LL = tmock(t, '{LIB}/commands/ll.js', {
|
|
|
|
'{LIB}/commands/ls.js': LS,
|
2021-03-04 17:40:28 -05:00
|
|
|
})
|
|
|
|
const ll = new LL({
|
2020-10-02 17:52:19 -04:00
|
|
|
config: {
|
2021-03-04 17:40:28 -05:00
|
|
|
set: (key, value) => {
|
|
|
|
t.equal(key, 'long', 'should set long config value')
|
|
|
|
t.equal(value, true, 'should set a truthy value')
|
2020-11-17 15:37:44 -05:00
|
|
|
},
|
|
|
|
},
|
2021-03-04 17:40:28 -05:00
|
|
|
})
|
2020-10-02 17:52:19 -04:00
|
|
|
|
2021-03-04 17:40:28 -05:00
|
|
|
ll.exec(['pkg'], err => {
|
2021-11-18 20:58:02 +00:00
|
|
|
if (err) {
|
2021-03-04 17:40:28 -05:00
|
|
|
throw err
|
2021-11-18 20:58:02 +00:00
|
|
|
}
|
2020-10-02 17:52:19 -04:00
|
|
|
})
|
|
|
|
})
|