There was an error while loading. Please reload this page.
1 parent 0357dec commit 95043f8Copy full SHA for 95043f8
1 file changed
Sprint-2/interpret/invert.test.js
@@ -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
13
14
15
16
+test("should return an empty object", () => {
17
+ expect(invert({})).toEqual({});
18
0 commit comments