From 49fb6cc0493583b38988037a95b7676e14d442c0 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 23 Oct 2019 12:42:01 +0300 Subject: [PATCH] Hide user loaded message in tests --- test/tests/customhighlights.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/tests/customhighlights.js b/test/tests/customhighlights.js index 5511b902..43e161ff 100644 --- a/test/tests/customhighlights.js +++ b/test/tests/customhighlights.js @@ -1,12 +1,22 @@ "use strict"; const expect = require("chai").expect; - +const stub = require("sinon").stub; +const log = require("../../src/log"); const Client = require("../../src/client"); - -const client = new Client({}, "test", {clientSettings: {highlights: "foo, @all, sp ace , 고"}}); +const TestUtil = require("../util"); describe("Custom highlights", function() { + let userLoadedLog = ""; + stub(log, "info").callsFake(TestUtil.sanitizeLog((str) => (userLoadedLog += str))); + + const client = new Client({}, "test", { + clientSettings: {highlights: "foo, @all, sp ace , 고"}, + }); + + log.info.restore(); + expect(userLoadedLog).to.equal("User test loaded\n"); + it("should NOT highlight", function() { const teststrings = [ "and foos stuff",