Skip to content

Commit 58c9bbd

Browse files
committed
Add missing sourcesContent & mappings test cases
Covers a few additional error cases that were actually missing from the test coverage.
1 parent 41c3d30 commit 58c9bbd

11 files changed

+73
-0
lines changed

resources/mappings-missing.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/mappings-missing.js.map

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-missing.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-missing.js.map

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-not-a-list-1.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-not-a-list-1.js.map

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-not-a-list-2.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-not-a-list-2.js.map

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-not-string-or-null.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/sources-content-not-string-or-null.js.map

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source-map-spec-tests.json

+35
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
"sourceMapFile": "version-too-low.js.map",
4343
"sourceMapIsValid": false
4444
},
45+
{
46+
"name": "mappingsMissing",
47+
"description": "Test a source map that is missing a necessary mappings field",
48+
"baseFile": "mappings-missing.js",
49+
"sourceMapFile": "mappings-missing.js.map",
50+
"sourceMapIsValid": false
51+
},
4552
{
4653
"name": "sourcesMissing",
4754
"description": "Test a source map that is missing a necessary sources field",
@@ -70,6 +77,34 @@
7077
"sourceMapFile": "sources-not-string-or-null.js.map",
7178
"sourceMapIsValid": false
7279
},
80+
{
81+
"name": "sourcesContentMissing",
82+
"description": "Test a source map that is missing an optional sourcesContent field",
83+
"baseFile": "sources-content-missing.js",
84+
"sourceMapFile": "sources-content-missing.js.map",
85+
"sourceMapIsValid": true
86+
},
87+
{
88+
"name": "sourcesContentNotAList1",
89+
"description": "Test a source map with a sourcesContent field that is not a valid list (string)",
90+
"baseFile": "sources-content-not-a-list-1.js",
91+
"sourceMapFile": "sources-content-not-a-list-1.js.map",
92+
"sourceMapIsValid": false
93+
},
94+
{
95+
"name": "sourcesContentNotAList2",
96+
"description": "Test a source map with a sourcesContent field that is not a valid list (object)",
97+
"baseFile": "sources-content-not-a-list-2.js",
98+
"sourceMapFile": "sources-content-not-a-list-2.js.map",
99+
"sourceMapIsValid": false
100+
},
101+
{
102+
"name": "sourcesContentNotStringOrNull",
103+
"description": "Test a source map with a sourcesContent list that has non-string and non-null items",
104+
"baseFile": "sources-not-string-or-null.js",
105+
"sourceMapFile": "sources-content-not-string-or-null.js.map",
106+
"sourceMapIsValid": false
107+
},
73108
{
74109
"name": "sourcesAndSourcesContentBothNull",
75110
"description": "Test a source map that has both null sources and sourcesContent entries",

0 commit comments

Comments
 (0)