mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:58:10 +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,50 +1,50 @@
|
|||
test("basic functionality", () => {
|
||||
expect(function () {}.name).toBe("");
|
||||
expect(function () {}.name).toBe("");
|
||||
|
||||
function bar() {}
|
||||
expect(bar.name).toBe("bar");
|
||||
expect((bar.name = "baz")).toBe("baz");
|
||||
expect(bar.name).toBe("bar");
|
||||
function bar() {}
|
||||
expect(bar.name).toBe("bar");
|
||||
expect((bar.name = "baz")).toBe("baz");
|
||||
expect(bar.name).toBe("bar");
|
||||
});
|
||||
|
||||
test("function assigned to variable", () => {
|
||||
let foo = function () {};
|
||||
expect(foo.name).toBe("foo");
|
||||
expect((foo.name = "bar")).toBe("bar");
|
||||
expect(foo.name).toBe("foo");
|
||||
let foo = function () {};
|
||||
expect(foo.name).toBe("foo");
|
||||
expect((foo.name = "bar")).toBe("bar");
|
||||
expect(foo.name).toBe("foo");
|
||||
|
||||
let a, b;
|
||||
a = b = function () {};
|
||||
expect(a.name).toBe("b");
|
||||
expect(b.name).toBe("b");
|
||||
let a, b;
|
||||
a = b = function () {};
|
||||
expect(a.name).toBe("b");
|
||||
expect(b.name).toBe("b");
|
||||
});
|
||||
|
||||
test("functions in array assigned to variable", () => {
|
||||
const arr = [function () {}, function () {}, function () {}];
|
||||
expect(arr[0].name).toBe("arr");
|
||||
expect(arr[1].name).toBe("arr");
|
||||
expect(arr[2].name).toBe("arr");
|
||||
const arr = [function () {}, function () {}, function () {}];
|
||||
expect(arr[0].name).toBe("arr");
|
||||
expect(arr[1].name).toBe("arr");
|
||||
expect(arr[2].name).toBe("arr");
|
||||
});
|
||||
|
||||
test("functions in objects", () => {
|
||||
let f;
|
||||
let o = { a: function () {} };
|
||||
let f;
|
||||
let o = { a: function () {} };
|
||||
|
||||
expect(o.a.name).toBe("a");
|
||||
f = o.a;
|
||||
expect(f.name).toBe("a");
|
||||
expect(o.a.name).toBe("a");
|
||||
expect(o.a.name).toBe("a");
|
||||
f = o.a;
|
||||
expect(f.name).toBe("a");
|
||||
expect(o.a.name).toBe("a");
|
||||
|
||||
o = { ...o, b: f };
|
||||
expect(o.a.name).toBe("a");
|
||||
expect(o.b.name).toBe("a");
|
||||
o = { ...o, b: f };
|
||||
expect(o.a.name).toBe("a");
|
||||
expect(o.b.name).toBe("a");
|
||||
|
||||
o.c = function () {};
|
||||
expect(o.c.name).toBe("c");
|
||||
o.c = function () {};
|
||||
expect(o.c.name).toBe("c");
|
||||
});
|
||||
|
||||
test("names of native functions", () => {
|
||||
expect(console.debug.name).toBe("debug");
|
||||
expect((console.debug.name = "warn")).toBe("warn");
|
||||
expect(console.debug.name).toBe("debug");
|
||||
expect(console.debug.name).toBe("debug");
|
||||
expect((console.debug.name = "warn")).toBe("warn");
|
||||
expect(console.debug.name).toBe("debug");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue