summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/process-logger.js
blob: 45c4e708cc1bbcc30c55ed18e52d1a6c9a33c35a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
const test = require('tap').test
require('../../lib/npm.js')

test('process logging', (t) => {
  t.ok(process.listenerCount('log') >= 1, `log listener attached ${process.listenerCount('log')} >= 1`)
  t.doesNotThrow(() => process.emit('log', 'error', 'test', 'this'), 'logging does not throw')
  t.doesNotThrow(() => process.emit('log', 2348), 'invalid args do not throw')
  t.doesNotThrow(() => process.emit('log', null), 'null does not throw')
  t.doesNotThrow(() => process.emit('log', {}), 'obj does not throw')
  t.done()
})