Merge pull request #3473 from thelounge/xpaw/hide-user-load-log

Hide user loaded message in tests
This commit is contained in:
Pavel Djundik 2019-10-23 12:47:11 +03:00 committed by GitHub
commit c72fce75de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,22 @@
"use strict"; "use strict";
const expect = require("chai").expect; const expect = require("chai").expect;
const stub = require("sinon").stub;
const log = require("../../src/log");
const Client = require("../../src/client"); const Client = require("../../src/client");
const TestUtil = require("../util");
const client = new Client({}, "test", {clientSettings: {highlights: "foo, @all, sp ace , 고"}});
describe("Custom highlights", function() { 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() { it("should NOT highlight", function() {
const teststrings = [ const teststrings = [
"and foos stuff", "and foos stuff",