1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 01:47:36 +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,72 +1,72 @@
test("basic functionality", () => {
class A {
static method() {
return 10;
class A {
static method() {
return 10;
}
}
}
expect(A.method()).toBe(10);
expect(new A().method).toBeUndefined();
expect(A.method()).toBe(10);
expect(new A().method).toBeUndefined();
});
test("extended name syntax", () => {
class A {
static method() {
return 1;
class A {
static method() {
return 1;
}
static 12() {
return 2;
}
static [`he${"llo"}`]() {
return 3;
}
}
static 12() {
return 2;
}
static [`he${"llo"}`]() {
return 3;
}
}
expect(A.method()).toBe(1);
expect(A[12]()).toBe(2);
expect(A.hello()).toBe(3);
expect(A.method()).toBe(1);
expect(A[12]()).toBe(2);
expect(A.hello()).toBe(3);
});
test("bound |this|", () => {
class A {
static method() {
expect(this).toBe(A);
class A {
static method() {
expect(this).toBe(A);
}
}
}
A.method();
A.method();
});
test("inherited static methods", () => {
class Parent {
static method() {
return 3;
class Parent {
static method() {
return 3;
}
}
}
class Child extends Parent {}
class Child extends Parent {}
expect(Parent.method()).toBe(3);
expect(Child.method()).toBe(3);
expect(new Parent()).not.toHaveProperty("method");
expect(new Child()).not.toHaveProperty("method");
expect(Parent.method()).toBe(3);
expect(Child.method()).toBe(3);
expect(new Parent()).not.toHaveProperty("method");
expect(new Child()).not.toHaveProperty("method");
});
test("static method overriding", () => {
class Parent {
static method() {
return 3;
class Parent {
static method() {
return 3;
}
}
}
class Child extends Parent {
static method() {
return 10;
class Child extends Parent {
static method() {
return 10;
}
}
}
expect(Parent.method()).toBe(3);
expect(Child.method()).toBe(10);
expect(Parent.method()).toBe(3);
expect(Child.method()).toBe(10);
});