Skip to content

Commit 4464835

Browse files
Add test for error handling when argument is not an array
1 parent a7d4b52 commit 4464835

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sprint-2/implement/lookup.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ test("creates a country currency code lookup for multiple codes", () => {
1010
).toEqual({ US: "USD", CA: "CAD", RO: "RON" });
1111
});
1212

13+
test("throw error if the argument is not an object", () => {
14+
expect(() => createLookup("notAnObject")).toThrow(
15+
"Argument must be an array"
16+
);
17+
});
1318
/*
1419
1520
Create a lookup object of key value pairs from an array of code pairs

0 commit comments

Comments
 (0)