Add missing key test

This commit is contained in:
Belma Gutlic 2020-01-13 16:18:10 +01:00
parent ce7f4118c2
commit 90af03ab02

View File

@ -1,6 +1,6 @@
import { expect, assert } from "chai";
import { KeyCache } from "../src/keycache";
import {createPeerIdsFromFixtures} from "./fixtures/peer";
import {createPeerIds, createPeerIdsFromFixtures} from "./fixtures/peer";
describe("KeyCache", () => {
let peerA, peerB;
@ -20,4 +20,15 @@ describe("KeyCache", () => {
assert(false, `Test failed - ${e.message}`)
}
});
it("should return undefined if key not found", async() => {
try {
const [newPeer] = await createPeerIds(1);
const result = await KeyCache.load(newPeer);
assert(!result);
} catch (e) {
console.error(e);
assert(false, `Test failed - ${e.message}`)
}
});
});