LibJS: Indent tests with 4 spaces instead of 2

This commit is contained in:
Matthew Olsson 2020-07-06 07:37:45 -07:00 committed by Andreas Kling
commit 1ef573eb30
Notes: sideshowbarker 2024-07-19 05:03:50 +09:00
261 changed files with 8536 additions and 8497 deletions

View file

@ -1,53 +1,53 @@
describe("correct behavior", () => {
test("basic functionality", () => {
let n = 0;
expect(++n).toBe(1);
expect(n).toBe(1);
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(0);
expect(n).toBe(1);
n = 0;
expect(--n).toBe(-1);
expect(n).toBe(-1);
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(0);
expect(n).toBe(-1);
let a = [];
expect(a++).toBe(0);
expect(a).toBe(1);
let a = [];
expect(a++).toBe(0);
expect(a).toBe(1);
let b = true;
expect(b--).toBe(1);
expect(b).toBe(0);
});
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();
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();
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");
});
test("update expression throws reference error", () => {
expect(() => {
++x;
}).toThrowWithMessage(ReferenceError, "'x' is not defined");
});
});