From cb3e6cf54a0bb274378dd771c2b851f2f2a2004a Mon Sep 17 00:00:00 2001 From: J Rob Gant Date: Mon, 29 Jun 2020 16:43:42 -0400 Subject: [PATCH 1/2] Failing multiple config test case. --- spec/main.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/main.spec.ts b/spec/main.spec.ts index 9ff1cce..36896ba 100644 --- a/spec/main.spec.ts +++ b/spec/main.spec.ts @@ -143,5 +143,11 @@ describe('main', () => { mockConfig(config); expect(functions.config()).to.deep.equal(config); }); + + it('should allow multiple mock configurations', () => { + const config = { baz: { qux: 'quxx ' } }; + mockConfig(config); + expect(functions.config()).to.deep.equal(config); + }); }); }); From 881a125c2039ad3007a5742c1266aafa407c12b8 Mon Sep 17 00:00:00 2001 From: J Rob Gant Date: Mon, 29 Jun 2020 16:46:22 -0400 Subject: [PATCH 2/2] manually fix test setup --- spec/main.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/main.spec.ts b/spec/main.spec.ts index 36896ba..2a2d4bb 100644 --- a/spec/main.spec.ts +++ b/spec/main.spec.ts @@ -134,8 +134,9 @@ describe('main', () => { }); describe('#mockConfig', () => { - after(() => { + afterEach(() => { delete process.env.CLOUD_RUNTIME_CONFIG; + delete functions.config.singleton; }); it('should mock functions.config()', () => {