MCPcopy
hub / github.com/mozilla/source-map / expectedMap

Function expectedMap

test/test-source-map-generator.js:456–480  ·  view source on GitHub ↗
(sources)

Source from the content-addressed store, hash-verified

454 minifiedMap = await new SourceMapConsumer(minifiedMap.toJSON());
455
456 const expectedMap = function (sources) {
457 const map = new SourceMapGenerator({
458 file: "bundle.min.js",
459 sourceRoot: "..",
460 });
461 map.addMapping({
462 generated: { line: 1, column: 1 },
463 original: { line: 2, column: 2 },
464 source: sources[0],
465 });
466 map.setSourceContent(sources[0], "foo coffee");
467 map.addMapping({
468 generated: { line: 11, column: 11 },
469 original: { line: 12, column: 12 },
470 source: sources[1],
471 });
472 map.setSourceContent(sources[1], "bar coffee");
473 map.addMapping({
474 generated: { line: 21, column: 21 },
475 original: { line: 22, column: 22 },
476 source: sources[2],
477 });
478 map.setSourceContent(sources[2], "baz coffee");
479 return map.toJSON();
480 };
481
482 const actualMap = function (aSourceMapPath) {
483 const map = SourceMapGenerator.fromSourceMap(minifiedMap);

Callers 1

Calls 3

addMappingMethod · 0.95
setSourceContentMethod · 0.95
toJSONMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…