ladybird/Libraries/LibJS/Tests/builtins/AsyncDisposableStack/AsyncDisposableStack.js
Timothy Flynn 26c2484c2f LibJS: Implement the AsyncDisposableStack interface
This is very similar to the DisposableStack interface, except disposal
of resources is promise-based.
2025-01-17 20:46:32 +01:00

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");
});
});