mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 17:21:52 +00:00
This is very similar to the DisposableStack interface, except disposal of resources is promise-based.
21 lines
579 B
JavaScript
21 lines
579 B
JavaScript
test("constructor properties", () => {
|
|
expect(AsyncDisposableStack).toHaveLength(0);
|
|
expect(AsyncDisposableStack.name).toBe("AsyncDisposableStack");
|
|
});
|
|
|
|
describe("errors", () => {
|
|
test("called without new", () => {
|
|
expect(() => {
|
|
AsyncDisposableStack();
|
|
}).toThrowWithMessage(
|
|
TypeError,
|
|
"AsyncDisposableStack constructor must be called with 'new'"
|
|
);
|
|
});
|
|
});
|
|
|
|
describe("normal behavior", () => {
|
|
test("typeof", () => {
|
|
expect(typeof new AsyncDisposableStack()).toBe("object");
|
|
});
|
|
});
|