Skip to content

Commit 46805c8

Browse files
add inverttest
1 parent 9f2a22b commit 46805c8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎Sprint-2/interpret/invert.test.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const invert = require("./invert.js");
2+
3+
test("swaps the keys and values in an object", () => {
4+
expect(invert({ a: 1, b: 2 })).toEqual({
5+
1: "a",
6+
2: "b",
7+
});
8+
});
9+
10+
test("returns an empty object for an empty object", () => {
11+
expect(invert({})).toEqual({});
12+
});

0 commit comments

Comments
 (0)