Explicitly test address↔string function error case (#63)
Summary: `graph.js` coverage is now 100% :-) Test Plan: `yarn jest --env=jsdom --coverage` shows no uncovered lines for `graph.js`, and no failing tests. wchargin-branch: coverage-gremlin
This commit is contained in:
parent
9b203e8489
commit
50c575b2f9
|
@ -591,6 +591,14 @@ describe("graph", () => {
|
|||
it("rejects an Address with $-signs in id", () => {
|
||||
expectRejection("id", "issue$123");
|
||||
});
|
||||
it("rejects a null address", () => {
|
||||
expect(() => addressToString((null: any))).toThrow("address is null");
|
||||
});
|
||||
it("rejects a undefined address", () => {
|
||||
expect(() => addressToString((undefined: any))).toThrow(
|
||||
"address is undefined"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("stringToAddress", () => {
|
||||
|
@ -610,6 +618,16 @@ describe("graph", () => {
|
|||
expect(() => stringToAddress(input)).toThrow(/exactly two \$s/);
|
||||
});
|
||||
});
|
||||
it("rejects a null address string", () => {
|
||||
expect(() => stringToAddress((null: any))).toThrow(
|
||||
"address string is null"
|
||||
);
|
||||
});
|
||||
it("rejects a undefined address string", () => {
|
||||
expect(() => stringToAddress((undefined: any))).toThrow(
|
||||
"address string is undefined"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("stringToAddress and addressToString interop", () => {
|
||||
|
|
Loading…
Reference in New Issue