Skip to content

Commit 95043f8

Browse files
committed
writing tests
1 parent 0357dec commit 95043f8

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Sprint-2/interpret/invert.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const invert = require("./invert.js");
2+
3+
test("should invert an object", () => {
4+
expect(invert({ a: 1, b: 2 })).toEqual({
5+
1: "a",
6+
2: "b",
7+
});
8+
});
9+
10+
test("should invert an object with one property", () => {
11+
expect(invert({ a: 1 })).toEqual({
12+
1: "a",
13+
});
14+
});
15+
16+
test("should return an empty object", () => {
17+
expect(invert({})).toEqual({});
18+
});

0 commit comments

Comments
 (0)