mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
Fixed nodemon to echo out what's being watched in the regexp instead of the config.dir path. Also allowing patterns on the "watch" config setting, rather than just paths. Removed useless test (that kept failing...incorrectly).
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
'use strict';
|
|
/*global describe:true, it: true */
|
|
var logger = require('../../lib/utils/log')(true),
|
|
bus = require('../../lib/utils/bus'),
|
|
colour = require('../../lib/utils/colour'),
|
|
assert = require('assert');
|
|
|
|
describe('logger', function () {
|
|
var types = {
|
|
log: 'black',
|
|
info: 'yellow',
|
|
status: 'green',
|
|
detail: 'yellow',
|
|
fail: 'red',
|
|
error: 'red'
|
|
};
|
|
|
|
logger.debug = true;
|
|
|
|
Object.keys(types).forEach(function (type) {
|
|
it('should .' + type, function (done) {
|
|
bus.once('log', function (event) {
|
|
assert(event.message === type);
|
|
assert(event.colour.indexOf(colour[types[type]]) !== -1);
|
|
done();
|
|
});
|
|
logger[type](type);
|
|
});
|
|
});
|
|
|
|
// it('should not log detail if debug is off', function (done) {
|
|
// logger.debug = false;
|
|
|
|
// function handler() {
|
|
// assert(false, 'logged a message when we should not have done');
|
|
// bus.removeListener('log', handler);
|
|
// done();
|
|
// }
|
|
|
|
// bus.addListener('log', handler);
|
|
|
|
// logger.detail('detail');
|
|
|
|
// setTimeout(function () {
|
|
// bus.removeListener('log', handler);
|
|
// done();
|
|
// }, 500);
|
|
// });
|
|
}); |