mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
28 lines
757 B
JavaScript
28 lines
757 B
JavaScript
import _mergeSourceMap from "../lib/transformation/file/merge-map.js";
|
|
const mergeSourceMap = _mergeSourceMap.default || _mergeSourceMap;
|
|
|
|
describe("merge-map", () => {
|
|
it("returns a plain js object", () => {
|
|
const inputMap = {
|
|
file: "file.js",
|
|
mappings: [],
|
|
names: [],
|
|
sources: ["file.ts"],
|
|
version: 3,
|
|
};
|
|
|
|
const outputMap = {
|
|
file: "file.transpiled.js",
|
|
mappings: [],
|
|
names: [],
|
|
sources: ["file.js"],
|
|
version: 3,
|
|
};
|
|
|
|
const map = mergeSourceMap(inputMap, outputMap, "file.transpiled.js");
|
|
expect(typeof map).toBe("object");
|
|
expect(Object.prototype.toString.call(map)).toBe("[object Object]");
|
|
expect(Object.getPrototypeOf(map)).toBe(Object.prototype);
|
|
});
|
|
});
|