mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
Co-authored-by: Claude <claude@anthropic.ai> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
28 lines
787 B
JavaScript
28 lines
787 B
JavaScript
const { test, expect } = require("bun:test");
|
|
|
|
test("SourceMap is available from node:module", () => {
|
|
const module = require("node:module");
|
|
expect(module.SourceMap).toBeDefined();
|
|
expect(typeof module.SourceMap).toBe("function");
|
|
});
|
|
|
|
test("SourceMap from require('module') works", () => {
|
|
const module = require("module");
|
|
expect(module.SourceMap).toBeDefined();
|
|
expect(typeof module.SourceMap).toBe("function");
|
|
});
|
|
|
|
test("Can create SourceMap instance from node:module", () => {
|
|
const { SourceMap } = require("node:module");
|
|
const payload = {
|
|
version: 3,
|
|
sources: ["test.js"],
|
|
names: [],
|
|
mappings: "AAAA",
|
|
};
|
|
|
|
const sourceMap = new SourceMap(payload);
|
|
expect(sourceMap).toBeInstanceOf(SourceMap);
|
|
expect(sourceMap.payload).toBe(payload);
|
|
});
|