Hide unknown key warning in mergeConfig test
This commit is contained in:
parent
92098286e7
commit
04dc1feaba
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const log = require("../../src/log");
|
const log = require("../../src/log");
|
||||||
const expect = require("chai").expect;
|
const expect = require("chai").expect;
|
||||||
|
const stub = require("sinon").stub;
|
||||||
const mergeConfig = require("../../src/helper").mergeConfig;
|
const mergeConfig = require("../../src/helper").mergeConfig;
|
||||||
|
|
||||||
describe("mergeConfig", function() {
|
describe("mergeConfig", function() {
|
||||||
@ -34,6 +35,9 @@ describe("mergeConfig", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should extend objects", function() {
|
it("should extend objects", function() {
|
||||||
|
let warning = "";
|
||||||
|
stub(log, "warn").callsFake((str) => warning += str);
|
||||||
|
|
||||||
expect(mergeConfig({
|
expect(mergeConfig({
|
||||||
tlsOptions: {},
|
tlsOptions: {},
|
||||||
}, {
|
}, {
|
||||||
@ -47,6 +51,9 @@ describe("mergeConfig", function() {
|
|||||||
thing: 123,
|
thing: 123,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
log.warn.restore();
|
||||||
|
expect(warning).to.contain("Unknown key");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should allow changing nulls", function() {
|
it("should allow changing nulls", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user