Permalink
Browse files

fix broken test

  • Loading branch information...
1 parent e72ae44 commit e24721dfe08338deec1de3d405e50f1821afe7d5 @isaacs isaacs committed Oct 24, 2013
Showing with 16 additions and 249 deletions.
  1. +16 −249 test/basic.js
View
@@ -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')

0 comments on commit e24721d

Please sign in to comment.