diff options
author | 2023-02-22 19:07:27 -0800 | |
---|---|---|
committer | 2023-02-22 19:07:27 -0800 | |
commit | 2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59 (patch) | |
tree | 62c4562c4a86b90e8456657ebecd2a416d06721d /test/bun.js/inspect.test.js | |
parent | 0911bd3af2aceca487f3159f20c0400fb45bdc92 (diff) | |
download | bun-2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59.tar.gz bun-2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59.tar.zst bun-2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59.zip |
[breaking] Return Node.js `Timeout` objects in `setTimeout`, `setInterval`, and `setImmediate`
Fixes #2129 #880
Diffstat (limited to 'test/bun.js/inspect.test.js')
-rw-r--r-- | test/bun.js/inspect.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bun.js/inspect.test.js b/test/bun.js/inspect.test.js index 229f80548..243f23cdc 100644 --- a/test/bun.js/inspect.test.js +++ b/test/bun.js/inspect.test.js @@ -1,5 +1,14 @@ import { it, expect, describe } from "bun:test"; +it("Timeout", () => { + const id = setTimeout(() => {}, 0); + expect(Bun.inspect(id)).toBe(`Timeout (#${+id})`); + + const id2 = setInterval(() => {}, 1); + id2.unref(); + expect(Bun.inspect(id2)).toBe(`Timeout (#${+id2}, repeats)`); +}); + it("when prototype defines the same property, don't print the same property twice", () => { var base = { foo: "123", |