DisposableStack.js 515 B

123456789101112131415161718
  1. test("constructor properties", () => {
  2. expect(DisposableStack).toHaveLength(0);
  3. expect(DisposableStack.name).toBe("DisposableStack");
  4. });
  5. describe("errors", () => {
  6. test("called without new", () => {
  7. expect(() => {
  8. DisposableStack();
  9. }).toThrowWithMessage(TypeError, "DisposableStack constructor must be called with 'new'");
  10. });
  11. });
  12. describe("normal behavior", () => {
  13. test("typeof", () => {
  14. expect(typeof new DisposableStack()).toBe("object");
  15. });
  16. });