log4js-node/test/tap/no-cluster-test.js
2019-08-12 08:32:27 +10:00

16 lines
567 B
JavaScript

const { test } = require("tap");
const proxyquire = require("proxyquire");
test("clustering is disabled if cluster is not present", t => {
const log4js = proxyquire("../../lib/log4js", { cluster: null });
const recorder = require("../../lib/appenders/recording");
log4js.configure({
appenders: { vcr: { type: "recording" } },
categories: { default: { appenders: ["vcr"], level: "debug" } }
});
log4js.getLogger().info("it should still work");
const events = recorder.replay();
t.equal(events[0].data[0], "it should still work");
t.end();
});