From 04dc1feaba0480240c4eee31971a3eb351be191a Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 20 Mar 2019 12:58:30 +0200 Subject: [PATCH] Hide unknown key warning in mergeConfig test --- test/tests/mergeConfig.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/tests/mergeConfig.js b/test/tests/mergeConfig.js index 89762da7..6942355d 100644 --- a/test/tests/mergeConfig.js +++ b/test/tests/mergeConfig.js @@ -2,6 +2,7 @@ const log = require("../../src/log"); const expect = require("chai").expect; +const stub = require("sinon").stub; const mergeConfig = require("../../src/helper").mergeConfig; describe("mergeConfig", function() { @@ -34,6 +35,9 @@ describe("mergeConfig", function() { }); it("should extend objects", function() { + let warning = ""; + stub(log, "warn").callsFake((str) => warning += str); + expect(mergeConfig({ tlsOptions: {}, }, { @@ -47,6 +51,9 @@ describe("mergeConfig", function() { thing: 123, }, }); + + log.warn.restore(); + expect(warning).to.contain("Unknown key"); }); it("should allow changing nulls", function() {