Skip to content

Commit 7d98b58

Browse files
add testcase
1 parent 1105531 commit 7d98b58

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/load.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,5 +433,18 @@ describe("load", function () {
433433
expect(settings).not.undefined;
434434
expect(settings).not.undefined;
435435
expect(settings.get("TestKey")).eq("TestValue");
436+
restoreMocks();
437+
});
438+
439+
it("should throw error when snapshot composition type is not key", async () => {
440+
const snapshotName = "Test";
441+
mockAppConfigurationClientGetSnapshot(snapshotName, {compositionType: "key_label"});
442+
const connectionString = createMockedConnectionString();
443+
expect(load(connectionString, {
444+
selectors: [{
445+
snapshotName: snapshotName
446+
}]
447+
})).eventually.rejectedWith(`Composition type for the selected snapshot with name ${snapshotName} must be 'key'.`);
448+
restoreMocks();
436449
});
437450
});

0 commit comments

Comments
 (0)