mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:47:35 +00:00
LibJS: Indent tests with 4 spaces instead of 2
This commit is contained in:
parent
15de2eda2b
commit
1ef573eb30
261 changed files with 8536 additions and 8497 deletions
|
@ -1,35 +1,35 @@
|
|||
test("extending function", () => {
|
||||
class A extends function () {
|
||||
this.foo = 10;
|
||||
} {}
|
||||
class A extends function () {
|
||||
this.foo = 10;
|
||||
} {}
|
||||
|
||||
expect(new A().foo).toBe(10);
|
||||
expect(new A().foo).toBe(10);
|
||||
});
|
||||
|
||||
test("extending null", () => {
|
||||
class A extends null {}
|
||||
class A extends null {}
|
||||
|
||||
expect(Object.getPrototypeOf(A.prototype)).toBeNull();
|
||||
expect(Object.getPrototypeOf(A.prototype)).toBeNull();
|
||||
|
||||
expect(() => {
|
||||
new A();
|
||||
}).toThrowWithMessage(ReferenceError, "|this| has not been initialized");
|
||||
expect(() => {
|
||||
new A();
|
||||
}).toThrowWithMessage(ReferenceError, "|this| has not been initialized");
|
||||
});
|
||||
|
||||
test("extending String", () => {
|
||||
class MyString extends String {}
|
||||
class MyString extends String {}
|
||||
|
||||
const ms = new MyString("abc");
|
||||
expect(ms).toBeInstanceOf(MyString);
|
||||
expect(ms).toBeInstanceOf(String);
|
||||
expect(ms.charAt(1)).toBe("b");
|
||||
const ms = new MyString("abc");
|
||||
expect(ms).toBeInstanceOf(MyString);
|
||||
expect(ms).toBeInstanceOf(String);
|
||||
expect(ms.charAt(1)).toBe("b");
|
||||
|
||||
class MyString2 extends MyString {
|
||||
charAt(i) {
|
||||
return `#${super.charAt(i)}`;
|
||||
class MyString2 extends MyString {
|
||||
charAt(i) {
|
||||
return `#${super.charAt(i)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ms2 = new MyString2("abc");
|
||||
expect(ms2.charAt(1)).toBe("#b");
|
||||
const ms2 = new MyString2("abc");
|
||||
expect(ms2.charAt(1)).toBe("#b");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue