mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge branch 'refactor-tap' into ci/update-ci
This commit is contained in:
commit
20ca0e54ad
@ -8,12 +8,18 @@ let log4js;
|
||||
let recording;
|
||||
|
||||
test('log4js appender dependencies', (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
log4js = require('../../lib/log4js');
|
||||
recording = require('../../lib/appenders/recording');
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
batch.afterEach(() => {
|
||||
batch.afterEach((done) => {
|
||||
recording.erase();
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
batch.test('in order', (t) => {
|
||||
const config = {
|
||||
|
||||
@ -3,8 +3,11 @@ const log4js = require('../../lib/log4js');
|
||||
const recording = require('../../lib/appenders/recording');
|
||||
|
||||
test('log4js categoryFilter', (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
recording.reset();
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
batch.test('appender should exclude categories', (t) => {
|
||||
|
||||
@ -10,7 +10,7 @@ let dependencies;
|
||||
let fileRead;
|
||||
|
||||
test('log4js configure', (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
fileRead = 0;
|
||||
|
||||
fakeFS = {
|
||||
@ -55,6 +55,10 @@ test('log4js configure', (batch) => {
|
||||
fs: fakeFS,
|
||||
},
|
||||
};
|
||||
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
batch.test(
|
||||
|
||||
@ -68,8 +68,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, { context: true });
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.contexts = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('response should be included in context', (assert) => {
|
||||
@ -96,8 +99,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, {});
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.contexts = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('response should not be included in context', (assert) => {
|
||||
|
||||
@ -59,8 +59,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, { nolog: '\\.gif' });
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.messages = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('check unmatch url request', (assert) => {
|
||||
@ -106,8 +109,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, { nolog: '\\.gif|\\.jpe?g' });
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.messages = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('check unmatch url request (png)', (assert) => {
|
||||
@ -167,8 +173,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, { nolog: ['\\.gif', '\\.jpe?g'] });
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.messages = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('check unmatch url request (png)', (assert) => {
|
||||
@ -228,8 +237,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, { nolog: /\.gif|\.jpe?g/ });
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.messages = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('check unmatch url request (png)', (assert) => {
|
||||
@ -289,8 +301,11 @@ test('log4js connect logger', (batch) => {
|
||||
const ml = new MockLogger();
|
||||
const cl = clm(ml, { nolog: [/\.gif/, /\.jpe?g/] });
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.messages = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('check unmatch url request (png)', (assert) => {
|
||||
@ -353,8 +368,11 @@ test('log4js connect logger', (batch) => {
|
||||
res.getHeader('content-type') === 'image/png' || res.statusCode < 400,
|
||||
});
|
||||
|
||||
t.beforeEach(() => {
|
||||
t.beforeEach((done) => {
|
||||
ml.messages = [];
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
t.test('check unmatch function return (statusCode < 400)', (assert) => {
|
||||
|
||||
@ -35,9 +35,12 @@ const testConfig = {
|
||||
};
|
||||
|
||||
test('../../lib/logger', (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
events.length = 0;
|
||||
testConfig.level = levels.TRACE;
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
batch.test('constructor with no parameters', (t) => {
|
||||
|
||||
@ -51,8 +51,11 @@ function makeFakeNet() {
|
||||
}
|
||||
|
||||
test('Multiprocess Appender', async (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
recording.erase();
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
batch.test('worker', (t) => {
|
||||
|
||||
@ -3,8 +3,11 @@ const log4js = require('../../lib/log4js');
|
||||
const recording = require('../../lib/appenders/recording');
|
||||
|
||||
test('../../lib/logger', (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
recording.reset();
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
batch.test('creating a new log level', (t) => {
|
||||
|
||||
@ -6,8 +6,11 @@ const recording = require('../../lib/appenders/recording');
|
||||
* test a simple regexp
|
||||
*/
|
||||
test('log4js noLogFilter', (batch) => {
|
||||
batch.beforeEach(() => {
|
||||
batch.beforeEach((done) => {
|
||||
recording.reset();
|
||||
if (typeof done === 'function') {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
batch.test(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user