Skip to content
Permalink
Browse files

Allow configurationValue without path

[changelog:added]
  • Loading branch information...
cdupuis committed Mar 13, 2019
1 parent 738f2b2 commit 128f8e49081574e5709298fe10b23fa244bc0a0a
Showing with 15 additions and 1 deletion.
  1. +1 −1 lib/configuration.ts
  2. +14 −0 test/configuration.test.ts
@@ -358,7 +358,7 @@ export function defaultConfiguration(): Configuration {
* @param {string} path the property path evaluated against the configuration instance
* @returns {T}
*/
export function configurationValue<T>(path: string, defaultValue?: T): T {
export function configurationValue<T>(path: string = "", defaultValue?: T): T {
if (automationClientInstance()) {
const conf = automationClientInstance().configuration;
let value;
@@ -847,5 +847,19 @@ describe("configuration", () => {
assert.equal(v, false);
});

it("should resolve the entire configuration", () => {
(global as any).__runningAutomationClient = {
configuration: {
sdm: {
build: {
tag: false,
},
},
},
};
const v = configurationValue<Configuration>();
assert.deepStrictEqual(v, (global as any).__runningAutomationClient.configuration);
});

});
});

0 comments on commit 128f8e4

Please sign in to comment.
You can’t perform that action at this time.