diff options
author | 2022-05-11 03:19:29 -0700 | |
---|---|---|
committer | 2022-05-11 03:19:29 -0700 | |
commit | 47b6dc9eea9ccf93e217bf61492af4d52ac7ef3f (patch) | |
tree | 093fedfd1708ea67f32e815c5a72ed52b07b8f21 /integration/bunjs-only-snippets/import-meta.test.js | |
parent | aea3b4e280d45e7a95dc3d3ca22df62bdb3f3882 (diff) | |
download | bun-47b6dc9eea9ccf93e217bf61492af4d52ac7ef3f.tar.gz bun-47b6dc9eea9ccf93e217bf61492af4d52ac7ef3f.tar.zst bun-47b6dc9eea9ccf93e217bf61492af4d52ac7ef3f.zip |
Add test for import.meta.require
Diffstat (limited to 'integration/bunjs-only-snippets/import-meta.test.js')
-rw-r--r-- | integration/bunjs-only-snippets/import-meta.test.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/integration/bunjs-only-snippets/import-meta.test.js b/integration/bunjs-only-snippets/import-meta.test.js index 3dd02c205..c0d00f4c1 100644 --- a/integration/bunjs-only-snippets/import-meta.test.js +++ b/integration/bunjs-only-snippets/import-meta.test.js @@ -1,9 +1,16 @@ import { it, expect } from "bun:test"; +import sync from "./require-json.json"; const { path, dir } = import.meta; it("import.meta.resolveSync", () => { - expect(import.meta.resolveSync(import.meta.file, import.meta.dir)).toBe(path); + expect( + import.meta.resolveSync("./" + import.meta.file, import.meta.path) + ).toBe(path); +}); + +it("import.meta.require", () => { + expect(import.meta.require("./require-json.json").hello).toBe(sync.hello); }); it("import.meta.dir", () => { |