mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
|
@ -0,0 +1,57 @@
|
|||
describe("normal behavior", () => {
|
||||
test("length is 2", () => {
|
||||
expect(SuppressedError).toHaveLength(3);
|
||||
});
|
||||
|
||||
test("name is SuppressedError", () => {
|
||||
expect(SuppressedError.name).toBe("SuppressedError");
|
||||
});
|
||||
|
||||
test("Prototype of the SuppressedError constructor is the Error constructor", () => {
|
||||
expect(Object.getPrototypeOf(SuppressedError)).toBe(Error);
|
||||
});
|
||||
|
||||
test("Prototype of SuppressedError.prototype is Error.prototype", () => {
|
||||
expect(Object.getPrototypeOf(SuppressedError.prototype)).toBe(Error.prototype);
|
||||
});
|
||||
|
||||
test("construction", () => {
|
||||
expect(SuppressedError()).toBeInstanceOf(SuppressedError);
|
||||
expect(SuppressedError(1)).toBeInstanceOf(SuppressedError);
|
||||
expect(SuppressedError(1, 1)).toBeInstanceOf(SuppressedError);
|
||||
expect(new SuppressedError()).toBeInstanceOf(SuppressedError);
|
||||
expect(new SuppressedError(1)).toBeInstanceOf(SuppressedError);
|
||||
expect(new SuppressedError(1, 1)).toBeInstanceOf(SuppressedError);
|
||||
expect(Object.hasOwn(new SuppressedError(1, 1), "message")).toBeFalse();
|
||||
expect(new SuppressedError().toString()).toBe("SuppressedError");
|
||||
expect(new SuppressedError(1).toString()).toBe("SuppressedError");
|
||||
expect(new SuppressedError(1, 1).toString()).toBe("SuppressedError");
|
||||
expect(new SuppressedError(undefined, undefined, "Foo").toString()).toBe(
|
||||
"SuppressedError: Foo"
|
||||
);
|
||||
expect(new SuppressedError(1, 1, "Foo").toString()).toBe("SuppressedError: Foo");
|
||||
expect(Object.hasOwn(new SuppressedError(), "error")).toBeTrue();
|
||||
expect(Object.hasOwn(new SuppressedError(), "suppressed")).toBeTrue();
|
||||
const obj = {};
|
||||
expect(new SuppressedError(obj).error).toBe(obj);
|
||||
expect(new SuppressedError(null, obj).suppressed).toBe(obj);
|
||||
});
|
||||
|
||||
test("converts message to string", () => {
|
||||
expect(new SuppressedError(undefined, undefined, 1)).toHaveProperty("message", "1");
|
||||
expect(new SuppressedError(undefined, undefined, {})).toHaveProperty(
|
||||
"message",
|
||||
"[object Object]"
|
||||
);
|
||||
});
|
||||
|
||||
test("supports options object with cause", () => {
|
||||
const cause = new Error();
|
||||
const error = new SuppressedError(1, 2, "test", { cause });
|
||||
expect(error.hasOwnProperty("cause")).toBeTrue();
|
||||
expect(error.cause).toBe(cause);
|
||||
|
||||
const errorWithoutCase = new SuppressedError(1, 2, "test");
|
||||
expect(errorWithoutCase.hasOwnProperty("cause")).toBeFalse();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue