log-vault
Version:
A generator of Winston logger instance with pre-defined configurable transports and formats and extra functionality.
31 lines (30 loc) • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const NotificationChannel_1 = require("./NotificationChannel");
const waitForProcess_1 = require("../../test-files/util/waitForProcess");
const redisCleanup_1 = require("../../test-files/util/redisCleanup");
describe("NotificationChannel class", () => {
const queueName = "test-channel-queue";
beforeEach(async () => {
await (0, redisCleanup_1.redisCleanup)(queueName);
});
afterEach(async () => {
await (0, redisCleanup_1.redisCleanup)(queueName);
});
it("main notification channel class", async () => {
class TestChannel extends NotificationChannel_1.NotificationChannel {
constructor(opts) {
super(opts);
this.process({
queueName,
processor: async (job) => job.data
});
}
}
const testChannel = new TestChannel({ matchPatterns: [] });
testChannel.addToQueue("something");
const res = await (0, waitForProcess_1.waitForProcess)(queueName);
expect(res).toEqual("something");
await testChannel.stop();
});
});