xref: /third_party/node/deps/npm/test/lib/commands/ll.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/npm/test/lib/commands/
11cb0ef41Sopenharmony_ciconst t = require('tap')
21cb0ef41Sopenharmony_ciconst tmock = require('../../fixtures/tmock')
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_cit.test('ll', t => {
51cb0ef41Sopenharmony_ci  t.plan(3)
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci  class LS {
81cb0ef41Sopenharmony_ci    constructor (npm) {
91cb0ef41Sopenharmony_ci      this.npm = npm
101cb0ef41Sopenharmony_ci    }
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci    async exec (args) {
131cb0ef41Sopenharmony_ci      t.same(args, ['pkg'], 'should forward args')
141cb0ef41Sopenharmony_ci    }
151cb0ef41Sopenharmony_ci  }
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ci  const LL = tmock(t, '{LIB}/commands/ll.js', {
181cb0ef41Sopenharmony_ci    '{LIB}/commands/ls.js': LS,
191cb0ef41Sopenharmony_ci  })
201cb0ef41Sopenharmony_ci  const ll = new LL({
211cb0ef41Sopenharmony_ci    config: {
221cb0ef41Sopenharmony_ci      set: (key, value) => {
231cb0ef41Sopenharmony_ci        t.equal(key, 'long', 'should set long config value')
241cb0ef41Sopenharmony_ci        t.equal(value, true, 'should set a truthy value')
251cb0ef41Sopenharmony_ci      },
261cb0ef41Sopenharmony_ci    },
271cb0ef41Sopenharmony_ci  })
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci  ll.exec(['pkg'], err => {
301cb0ef41Sopenharmony_ci    if (err) {
311cb0ef41Sopenharmony_ci      throw err
321cb0ef41Sopenharmony_ci    }
331cb0ef41Sopenharmony_ci  })
341cb0ef41Sopenharmony_ci})
35

Indexes created Thu Nov 07 10:32:03 CST 2024