diff options
author | 2022-09-20 00:44:59 -0700 | |
---|---|---|
committer | 2022-09-20 00:44:59 -0700 | |
commit | 6163fb830e0462105fb709632eddd4deb3d7ee85 (patch) | |
tree | 08a4203bb5a6c9de0612674913b374cd9ba49c84 /test/bun.js/web-globals.test.js | |
parent | 167948f5c3afc0a4dc482222e42bd255951084ff (diff) | |
download | bun-6163fb830e0462105fb709632eddd4deb3d7ee85.tar.gz bun-6163fb830e0462105fb709632eddd4deb3d7ee85.tar.zst bun-6163fb830e0462105fb709632eddd4deb3d7ee85.zip |
Add `navigator.userAgent` , `navigator.hardwareConcurrency`
Diffstat (limited to '')
-rw-r--r-- | test/bun.js/web-globals.test.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/bun.js/web-globals.test.js b/test/bun.js/web-globals.test.js index 70c2f01e5..98157a785 100644 --- a/test/bun.js/web-globals.test.js +++ b/test/bun.js/web-globals.test.js @@ -105,3 +105,11 @@ it("URL.prototype.origin", () => { expect(host).toBe("html.spec.whatwg.org"); expect(origin).toBe("https://html.spec.whatwg.org"); }); + +test("navigator", () => { + expect(globalThis.navigator !== undefined).toBe(true); + const { version } = process; + const userAgent = `Bun/${version.substring(1)}`; + expect(navigator.hardwareConcurrency > 0).toBe(true); + expect(navigator.userAgent).toBe(userAgent); +}); |