diff options
Diffstat (limited to 'node_modules/npmlog/test/basic.js')
-rw-r--r-- | node_modules/npmlog/test/basic.js | 265 |
1 files changed, 16 insertions, 249 deletions
diff --git a/node_modules/npmlog/test/basic.js b/node_modules/npmlog/test/basic.js index 80c8c3184..1afcabd1c 100644 --- a/node_modules/npmlog/test/basic.js +++ b/node_modules/npmlog/test/basic.js @@ -9,254 +9,21 @@ var logPrefixEvents = [] var util = require('util') var resultExpect = -[ '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[7m', - 'sill', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'silly prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[34m', - '\u001b[40m', - 'verb', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'verbose prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[32m', - '\u001b[7m', - 'info', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'info prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[32m', - 'http', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'http prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[30m', - '\u001b[41m', - 'WARN', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[33m', - 'warn prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[31m', - '\u001b[40m', - 'ERR!', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'error prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[32m', - '\u001b[7m', - 'info', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'info prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[32m', - 'http', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'http prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[30m', - '\u001b[41m', - 'WARN', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'warn prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[31m', - '\u001b[40m', - 'ERR!', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - 'error prefix', - '\u001b[0m', - ' x = {"foo":{"bar":"baz"}}\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[31m', - '\u001b[40m', - 'ERR!', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - '404', - '\u001b[0m', - ' This is a longer\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[31m', - '\u001b[40m', - 'ERR!', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - '404', - '\u001b[0m', - ' message, with some details\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[31m', - '\u001b[40m', - 'ERR!', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - '404', - '\u001b[0m', - ' and maybe a stack.\n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[31m', - '\u001b[40m', - 'ERR!', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u001b[35m', - '404', - '\u001b[0m', - ' \n', - '\u001b[0m', - '\u001b[37m', - '\u001b[40m', - 'npm', - '\u001b[0m', - ' ', - '\u001b[0m', - '\u0007', - 'noise', - '\u001b[0m', - '\u001b[35m', - '', - '\u001b[0m', - ' LOUD NOISES\n', +[ '\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[7msill\u001b[0m \u001b[0m\u001b[35msilly prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[34m\u001b[40mverb\u001b[0m \u001b[0m\u001b[35mverbose prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[32minfo\u001b[0m \u001b[0m\u001b[35minfo prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[32m\u001b[40mhttp\u001b[0m \u001b[0m\u001b[35mhttp prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[30m\u001b[43mWARN\u001b[0m \u001b[0m\u001b[35mwarn prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35merror prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[32minfo\u001b[0m \u001b[0m\u001b[35minfo prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[32m\u001b[40mhttp\u001b[0m \u001b[0m\u001b[35mhttp prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[30m\u001b[43mWARN\u001b[0m \u001b[0m\u001b[35mwarn prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35merror prefix\u001b[0m x = {"foo":{"bar":"baz"}}\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35m404\u001b[0m This is a longer\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35m404\u001b[0m message, with some details\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35m404\u001b[0m and maybe a stack.\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35m404\u001b[0m \n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u0007noise\u001b[0m\u001b[35m\u001b[0m LOUD NOISES\n', '\u001b[0m' ] var logPrefixEventsExpect = @@ -451,7 +218,7 @@ tap.test('basic', function (t) { log.addLevel('noise', 10000, {beep: true}) log.noise(false, 'LOUD NOISES') - t.deepEqual(result, resultExpect, 'result') + t.deepEqual(result.join('').trim(), resultExpect.join('').trim(), 'result') t.deepEqual(log.record, logEventsExpect, 'record') t.deepEqual(logEvents, logEventsExpect, 'logEvents') t.deepEqual(logInfoEvents, logInfoEventsExpect, 'logInfoEvents') |