Debian Codegraph @

packages/babel-core/test/merge-map.js

raw
1 import _mergeSourceMap from "../lib/transformation/file/merge-map.js";
2 const mergeSourceMap = _mergeSourceMap.default || _mergeSourceMap;
3
4 describe("merge-map", () => {
5 it("returns a plain js object", () => {
6 const inputMap = {
7 file: "file.js",
8 mappings: [],
9 names: [],
10 sources: ["file.ts"],
11 version: 3,
12 };
13
14 const outputMap = {
15 file: "file.transpiled.js",
16 mappings: [],
17 names: [],
18 sources: ["file.js"],
19 version: 3,
20 };
21
22 const map = mergeSourceMap(inputMap, outputMap, "file.transpiled.js");
23 expect(typeof map).toBe("object");
24 expect(Object.prototype.toString.call(map)).toBe("[object Object]");
25 expect(Object.getPrototypeOf(map)).toBe(Object.prototype);
26 });
27 });