Skip to content

Commit db31543

Browse files
committed
chore: replace test
1 parent 433726e commit db31543

File tree

2 files changed

+16
-26
lines changed

2 files changed

+16
-26
lines changed

packages/vite/src/node/ssr/__tests__/__snapshots__/ssrLoadModule.spec.ts.snap

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ Expected ";" but found "code"
2121
2222
exports[`parse error 2`] = `
2323
{
24-
"frame": "",
24+
"frame": "1 | invalid code
25+
| ^
26+
2 | ",
2527
"id": "",
26-
"loc": undefined,
28+
"loc": {
29+
"column": 9,
30+
"file": "/fixtures/errors/syntax-error.js",
31+
"line": 1,
32+
},
2733
"message": "Expected ';', '}' or <eof>",
2834
}
2935
`;
@@ -49,9 +55,15 @@ Expected ";" but found "code"
4955
5056
exports[`parse error 4`] = `
5157
{
52-
"frame": "",
58+
"frame": "1 | invalid code
59+
| ^
60+
2 | ",
5361
"id": "",
54-
"loc": undefined,
62+
"loc": {
63+
"column": 9,
64+
"file": "/fixtures/errors/syntax-error.js",
65+
"line": 1,
66+
},
5567
"message": "Expected ';', '}' or <eof>",
5668
}
5769
`;

packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,25 +1205,3 @@ console.log(bar)
12051205
"
12061206
`)
12071207
})
1208-
1209-
test('parse error', async () => {
1210-
try {
1211-
await ssrTransform(`some bad code`, null, '/file.js', '')
1212-
expect.unreachable()
1213-
} catch (e) {
1214-
expect(e).toMatchInlineSnapshot(`[RollupError: Expected ';', '}' or <eof>]`)
1215-
expect({ ...e }).toMatchInlineSnapshot(`
1216-
{
1217-
"code": "PARSE_ERROR",
1218-
"frame": "1 | some bad code
1219-
| ^",
1220-
"loc": {
1221-
"column": 6,
1222-
"file": "/file.js",
1223-
"line": 1,
1224-
},
1225-
"pos": 5,
1226-
}
1227-
`)
1228-
}
1229-
})

0 commit comments

Comments
 (0)