Debian Codegraph @

smoke-tests/test/pack-json-output.js

raw
1
2 const t = require('tap')
3 const setup = require('./fixtures/setup.js')
4
5 t.test('pack --json returns only json on stdout', async t => {
6 const { npmLocal } = await setup(t)
7
8 const { stderr, stdout } = await npmLocal('pack', '--json', { force: true })
9
10 t.match(stderr, /> npm@.* prepack\n/, 'stderr has banner')
11 t.ok(JSON.parse(stdout), 'stdout can be parsed as json')
12 })