diff options
author | 2022-08-02 16:41:47 -0700 | |
---|---|---|
committer | 2022-08-02 16:41:47 -0700 | |
commit | ed9abb0cb0e19122f01b390a628edcab734b87a3 (patch) | |
tree | 20ba121f5557f84e1633ef06fee9135ca6c94715 /test/bun.js/process.test.js | |
parent | fcce3ff5ac821de270e5d0094d665ec079ef205e (diff) | |
download | bun-ed9abb0cb0e19122f01b390a628edcab734b87a3.tar.gz bun-ed9abb0cb0e19122f01b390a628edcab734b87a3.tar.zst bun-ed9abb0cb0e19122f01b390a628edcab734b87a3.zip |
[node.js compat] Implement `process.hrtime()` and `process.hrtime.bigint()`
Diffstat (limited to 'test/bun.js/process.test.js')
-rw-r--r-- | test/bun.js/process.test.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/bun.js/process.test.js b/test/bun.js/process.test.js index f82834a04..5131d3b28 100644 --- a/test/bun.js/process.test.js +++ b/test/bun.js/process.test.js @@ -1,4 +1,4 @@ -import { describe, it } from "bun:test"; +import { describe, expect, it } from "bun:test"; it("process", () => { // this property isn't implemented yet but it should at least return a string @@ -52,3 +52,17 @@ it("process", () => { console.log("SET CWD", process.chdir("../")); console.log("CWD", process.cwd()); }); + +it("process.hrtime()", () => { + const start = process.hrtime(); + const end = process.hrtime(start); + const end2 = process.hrtime(); + expect(end[0]).toBe(0); + expect(end2[1] > start[1]).toBe(true); +}); + +it("process.hrtime.bigint()", () => { + const start = process.hrtime.bigint(); + const end = process.hrtime.bigint(); + expect(end > start).toBe(true); +}); |