Skip to content

Commit 827f5b3

Browse files
committed
Fix: Add more invalid input types to invert tests
1 parent 1962dc2 commit 827f5b3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Sprint-2/interpret/invert.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ test("invert on an empty object returns an empty object", () => {
2626
expect(invert({})).toEqual({});
2727
});
2828

29-
// Given an invalid input like an array
29+
// Given an invalid input like an array, string, number, null or undefined
3030
// When passed to invert
3131
// Then it should throw an error
3232
test("invert throws an error for invalid input", () => {
3333
expect(() => invert([])).toThrow("Input must be an object");
34+
expect(() => invert("hello")).toThrow("Input must be an object");
35+
expect(() => invert(123)).toThrow("Input must be an object");
36+
expect(() => invert(null)).toThrow("Input must be an object");
37+
expect(() => invert(undefined)).toThrow("Input must be an object");
3438
});

0 commit comments

Comments
 (0)