MCPcopy Create free account
hub / github.com/dop251/goja / TestExtractSourceMapLine

Function TestExtractSourceMapLine

parser/parser_test.go:1189–1204  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1187}
1188
1189func TestExtractSourceMapLine(t *testing.T) {
1190 tt(t, func() {
1191 is(extractSourceMapLine(""), "")
1192 is(extractSourceMapLine("\n"), "")
1193 is(extractSourceMapLine(" "), "")
1194 is(extractSourceMapLine("1\n2\n3\n4\n"), "")
1195
1196 src := `"use strict";
1197var x = {};
1198//# sourceMappingURL=delme.js.map`
1199 modSrc := `(function(exports, require, module) {` + src + `
1200})`
1201 is(extractSourceMapLine(modSrc), "//# sourceMappingURL=delme.js.map")
1202 is(extractSourceMapLine(modSrc+"\n\n\n\n"), "//# sourceMappingURL=delme.js.map")
1203 })
1204}
1205
1206func TestSourceMapOptions(t *testing.T) {
1207 tt(t, func() {

Callers

nothing calls this directly

Calls 3

ttFunction · 0.85
isFunction · 0.85
extractSourceMapLineFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…