mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
Base+LibJS+LibWeb: Make prettier clean
Also use "// prettier-ignore" comments where necessary rather than excluding whole files (via .prettierignore).
This commit is contained in:
parent
76239f89c2
commit
5122f98198
24 changed files with 100 additions and 79 deletions
|
@ -50,8 +50,9 @@ describe("normal behavior", () => {
|
|||
let value = begin - 1;
|
||||
return {
|
||||
next() {
|
||||
if (value < end)
|
||||
if (value < end) {
|
||||
value += 1;
|
||||
}
|
||||
return { value: value, done: value >= end };
|
||||
},
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@ test("tuple constructor", () => {
|
|||
expect(new Date(2019, 11).getMilliseconds()).toBe(0);
|
||||
expect(new Date(2019, 11).getDay()).toBe(0);
|
||||
|
||||
let date = new Date(2019, 11, 15, 9, 16, 14, 123); // Note: Month is 0-based.
|
||||
let date = new Date(2019, 11, 15, 9, 16, 14, 123); // Note: Month is 0-based.
|
||||
expect(date.getFullYear()).toBe(2019);
|
||||
expect(date.getMonth()).toBe(11);
|
||||
expect(date.getDate()).toBe(15);
|
||||
|
@ -48,14 +48,14 @@ test("tuple constructor", () => {
|
|||
expect(date.getDay()).toBe(0);
|
||||
|
||||
// getTime() returns a time stamp in UTC, but we can at least check it's in the right interval, which will be true independent of the local timezone if the range is big enough.
|
||||
let timestamp_lower_bound = 1575072000000; // 2019-12-01T00:00:00Z
|
||||
let timestamp_upper_bound = 1577750400000; // 2019-12-31T00:00:00Z
|
||||
let timestamp_lower_bound = 1575072000000; // 2019-12-01T00:00:00Z
|
||||
let timestamp_upper_bound = 1577750400000; // 2019-12-31T00:00:00Z
|
||||
expect(date.getTime()).toBeGreaterThan(timestamp_lower_bound);
|
||||
expect(date.getTime()).toBeLessThan(timestamp_upper_bound);
|
||||
});
|
||||
|
||||
test("tuple constructor overflow", () => {
|
||||
let date = new Date(2019, 13, 33, 30, 70, 80, 2345);
|
||||
let date = new Date(2019, 13, 33, 30, 70, 80, 2345);
|
||||
expect(date.getFullYear()).toBe(2020);
|
||||
expect(date.getMonth()).toBe(2);
|
||||
expect(date.getDate()).toBe(5);
|
||||
|
@ -65,7 +65,7 @@ test("tuple constructor overflow", () => {
|
|||
expect(date.getMilliseconds()).toBe(345);
|
||||
expect(date.getDay()).toBe(4);
|
||||
|
||||
let date = new Date(2019, -13, -33, -30, -70, -80, -2345);
|
||||
let date = new Date(2019, -13, -33, -30, -70, -80, -2345);
|
||||
expect(date.getFullYear()).toBe(2017);
|
||||
expect(date.getMonth()).toBe(9);
|
||||
expect(date.getDate()).toBe(26);
|
||||
|
|
|
@ -42,11 +42,14 @@ describe("[[Get]] trap normal behavior", () => {
|
|||
});
|
||||
|
||||
test("custom receiver value", () => {
|
||||
let p = new Proxy({}, {
|
||||
get(target, property, receiver) {
|
||||
return receiver;
|
||||
},
|
||||
});
|
||||
let p = new Proxy(
|
||||
{},
|
||||
{
|
||||
get(target, property, receiver) {
|
||||
return receiver;
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
expect(Reflect.get(p, "foo", 42)).toBe(42);
|
||||
});
|
||||
|
|
|
@ -40,7 +40,7 @@ describe("[[Set]] trap normal behavior", () => {
|
|||
expect(p.foo).toBe(20);
|
||||
p.foo = 10;
|
||||
expect(p.foo).toBe(10);
|
||||
p[Symbol.hasInstance] = "foo"
|
||||
p[Symbol.hasInstance] = "foo";
|
||||
expect(p[Symbol.hasInstance]).toBe("foo");
|
||||
});
|
||||
|
||||
|
|
|
@ -6,5 +6,6 @@ test("basic functionality", () => {
|
|||
expect(/foo/s.flags).toBe("s");
|
||||
expect(/foo/u.flags).toBe("u");
|
||||
expect(/foo/y.flags).toBe("y");
|
||||
// prettier-ignore
|
||||
expect(/foo/sgimyu.flags).toBe("gimsuy");
|
||||
});
|
||||
|
|
|
@ -34,6 +34,9 @@ test("basic functionality", () => {
|
|||
expect(s.endsWith("", -1)).toBeTrue();
|
||||
expect(s.endsWith("", 42)).toBeTrue();
|
||||
expect("12undefined".endsWith()).toBeTrue();
|
||||
expect(() => s.endsWith(/foobar/)).toThrowWithMessage(TypeError, "searchString is not a string, but a regular expression");
|
||||
expect(() => s.endsWith(/foobar/)).toThrowWithMessage(
|
||||
TypeError,
|
||||
"searchString is not a string, but a regular expression"
|
||||
);
|
||||
expect(s.endsWith("bar", undefined)).toBeTrue();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue