PR-URL: https://github.com/nodejs/node/pull/46193 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
35 lines
620 B
JavaScript
35 lines
620 B
JavaScript
const t = require('tap')
|
|
const tmock = require('../../fixtures/tmock')
|
|
|
|
t.test('ll', t => {
|
|
t.plan(3)
|
|
|
|
class LS {
|
|
constructor (npm) {
|
|
this.npm = npm
|
|
}
|
|
|
|
async exec (args) {
|
|
t.same(args, ['pkg'], 'should forward args')
|
|
}
|
|
}
|
|
|
|
const LL = tmock(t, '{LIB}/commands/ll.js', {
|
|
'{LIB}/commands/ls.js': LS,
|
|
})
|
|
const ll = new LL({
|
|
config: {
|
|
set: (key, value) => {
|
|
t.equal(key, 'long', 'should set long config value')
|
|
t.equal(value, true, 'should set a truthy value')
|
|
},
|
|
},
|
|
})
|
|
|
|
ll.exec(['pkg'], err => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
})
|
|
})
|