mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 22:15:50 +00:00
test(sourcemap): consolidate indexed section admission checks (#13066)
This commit is contained in:
1 parent
5bbd238f2f
commit
47d86582c8
4 files changed
+153
-271
No files matched your search
@@ -394,13 +394,14 @@ it.each([false, true])(
|
||||
|
||||
it.each([
|
||||
{
|
||||
failure: "external section",
|
||||
failure: "external section with an embedded fallback",
|
||||
text: JSON.stringify({
|
||||
version: 3,
|
||||
sections: [
|
||||
{
|
||||
offset: { line: 0, column: 0 },
|
||||
url: "https://app.test/external.map",
|
||||
map: JSON.parse(fixture.sourceMap.text) as unknown,
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -410,6 +411,30 @@ it.each([
|
||||
userMessage: expect.stringContaining("https://app.test/external.map"),
|
||||
},
|
||||
},
|
||||
{
|
||||
failure: "malformed section URL with an embedded fallback",
|
||||
text: JSON.stringify({
|
||||
version: 3,
|
||||
sections: [
|
||||
{
|
||||
offset: { line: 0, column: 0 },
|
||||
url: 12,
|
||||
map: JSON.parse(fixture.sourceMap.text) as unknown,
|
||||
},
|
||||
],
|
||||
}),
|
||||
error: {
|
||||
_tag: "AnalysisInputError",
|
||||
issues: [
|
||||
{
|
||||
reason: "invalid_format",
|
||||
message: expect.stringMatching(
|
||||
/section URL.*must be a string.*\[0\]/iu,
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
failure: "malformed embedded map before row admission",
|
||||
text: JSON.stringify({
|
||||
|
||||
Reference in new issue
Block a user