mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 14:32:18 +00:00
Add missing key test
This commit is contained in:
parent
ce7f4118c2
commit
90af03ab02
@ -1,6 +1,6 @@
|
|||||||
import { expect, assert } from "chai";
|
import { expect, assert } from "chai";
|
||||||
import { KeyCache } from "../src/keycache";
|
import { KeyCache } from "../src/keycache";
|
||||||
import {createPeerIdsFromFixtures} from "./fixtures/peer";
|
import {createPeerIds, createPeerIdsFromFixtures} from "./fixtures/peer";
|
||||||
|
|
||||||
describe("KeyCache", () => {
|
describe("KeyCache", () => {
|
||||||
let peerA, peerB;
|
let peerA, peerB;
|
||||||
@ -20,4 +20,15 @@ describe("KeyCache", () => {
|
|||||||
assert(false, `Test failed - ${e.message}`)
|
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}`)
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user