diff options
Diffstat (limited to 'Libraries/LibJS/Tests/update-expressions-basic.js')
-rw-r--r-- | Libraries/LibJS/Tests/update-expressions-basic.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/Libraries/LibJS/Tests/update-expressions-basic.js b/Libraries/LibJS/Tests/update-expressions-basic.js deleted file mode 100644 index 5eacc6a069..0000000000 --- a/Libraries/LibJS/Tests/update-expressions-basic.js +++ /dev/null @@ -1,53 +0,0 @@ -describe("correct behavior", () => { - test("basic functionality", () => { - let n = 0; - expect(++n).toBe(1); - expect(n).toBe(1); - - n = 0; - expect(n++).toBe(0); - expect(n).toBe(1); - - n = 0; - expect(--n).toBe(-1); - expect(n).toBe(-1); - - n = 0; - expect(n--).toBe(0); - expect(n).toBe(-1); - - let a = []; - expect(a++).toBe(0); - expect(a).toBe(1); - - let b = true; - expect(b--).toBe(1); - expect(b).toBe(0); - }); - - test("updates that produce NaN", () => { - let s = "foo"; - expect(++s).toBeNaN(); - expect(s).toBeNaN(); - - s = "foo"; - expect(s++).toBeNaN(); - expect(s).toBeNaN(); - - s = "foo"; - expect(--s).toBeNaN(); - expect(s).toBeNaN(); - - s = "foo"; - expect(s--).toBeNaN(); - expect(s).toBeNaN(); - }); -}); - -describe("errors", () => { - test("update expression throws reference error", () => { - expect(() => { - ++x; - }).toThrowWithMessage(ReferenceError, "'x' is not defined"); - }); -}); |