1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

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
parent 15de2eda2b
commit 1ef573eb30
261 changed files with 8536 additions and 8497 deletions

View file

@ -1,80 +1,80 @@
describe("correct behavior", () => {
test("basic functionality", () => {
class A {
static get x() {
return 10;
}
}
test("basic functionality", () => {
class A {
static get x() {
return 10;
}
}
expect(A.x).toBe(10);
expect(new A()).not.toHaveProperty("x");
});
expect(A.x).toBe(10);
expect(new A()).not.toHaveProperty("x");
});
test("name", () => {
class A {
static get x() {}
}
test("name", () => {
class A {
static get x() {}
}
const d = Object.getOwnPropertyDescriptor(A, "x");
expect(d.get.name).toBe("get x");
});
const d = Object.getOwnPropertyDescriptor(A, "x");
expect(d.get.name).toBe("get x");
});
test("extended name syntax", () => {
class A {
static get "method with space"() {
return 1;
}
test("extended name syntax", () => {
class A {
static get "method with space"() {
return 1;
}
static get 12() {
return 2;
}
static get 12() {
return 2;
}
static get [`he${"llo"}`]() {
return 3;
}
}
static get [`he${"llo"}`]() {
return 3;
}
}
expect(A["method with space"]).toBe(1);
expect(A[12]).toBe(2);
expect(A.hello).toBe(3);
});
expect(A["method with space"]).toBe(1);
expect(A[12]).toBe(2);
expect(A.hello).toBe(3);
});
test("inherited static getter", () => {
class Parent {
static get x() {
return 3;
}
}
test("inherited static getter", () => {
class Parent {
static get x() {
return 3;
}
}
class Child extends Parent {}
class Child extends Parent {}
expect(Parent.x).toBe(3);
expect(Child.x).toBe(3);
});
expect(Parent.x).toBe(3);
expect(Child.x).toBe(3);
});
test("inherited static getter overriding", () => {
class Parent {
static get x() {
return 3;
}
}
test("inherited static getter overriding", () => {
class Parent {
static get x() {
return 3;
}
}
class Child extends Parent {
static get x() {
return 10;
}
}
class Child extends Parent {
static get x() {
return 10;
}
}
expect(Parent.x).toBe(3);
expect(Child.x).toBe(10);
});
expect(Parent.x).toBe(3);
expect(Child.x).toBe(10);
});
});
describe("errors", () => {
test('"get static" is a syntax error', () => {
expect(`
test('"get static" is a syntax error', () => {
expect(`
class A {
get static foo() {}
}`).not.toEval();
});
});
});