@node-lightning/logger
Version:
Logging tool for Node-Lightning applications
22 lines (17 loc) • 576 B
text/typescript
import { expect } from "chai";
import fs from "fs";
import { FileTransport } from "../../lib/transports/file-transport";
const filePath = "test.log";
describe("ConsoleTransport", () => {
describe(".write", () => {
after(() => {
fs.unlinkSync(filePath);
});
it("should write to the console", () => {
const sut = new FileTransport(filePath);
sut.write("hello");
const actual = fs.readFileSync(filePath, { encoding: "utf8" });
expect(actual).to.equal("hello\n");
});
});
});