Skip to content

Commit

Permalink
test: add fallback tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofsl committed Jun 22, 2022
1 parent d639b25 commit 42ab9a8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@ describe("#getRipeConfigOptions()", function() {
url: "https://config.platforme.com/"
});
});

it("should return fallback options when environment isn't part of the available options", function() {
const uatEnvOptions = ripeCommons.getRipeCoreOptions("uat");
assert.deepStrictEqual(uatEnvOptions, {});
});

it("should return the given fallback options when environment isn't part of the available options", function() {
const fallbackEnvOptions = ripeCommons.getRipeCoreOptions("uat", {
url: "https://config.platforme.com/"
});
assert.deepStrictEqual(fallbackEnvOptions, {
url: "https://config.platforme.com/"
});
});
});

describe("#getRipeConfigPublicOptions()", function() {
Expand Down Expand Up @@ -311,4 +325,18 @@ describe("#getRipeConfigPublicOptions()", function() {
url: "https://config-public.platforme.com/"
});
});

it("should return fallback options when environment isn't part of the available options", function() {
const uatEnvOptions = ripeCommons.getRipeCoreOptions("uat");
assert.deepStrictEqual(uatEnvOptions, {});
});

it("should return the given fallback options when environment isn't part of the available options", function() {
const fallbackEnvOptions = ripeCommons.getRipeCoreOptions("uat", {
url: "https://config-public.platforme.com/"
});
assert.deepStrictEqual(fallbackEnvOptions, {
url: "https://config-public.platforme.com/"
});
});
});

0 comments on commit 42ab9a8

Please sign in to comment.