Skip to content

Commit b417a89

Browse files
committed
Update tests for changes in swc
1 parent af96212 commit b417a89

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

tests/mdx_esm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn mdx_esm() -> Result<(), String> {
120120
to_html_with_options("import a from 'b'\n*md*?", &swc)
121121
.err()
122122
.unwrap(),
123-
"2:6: Could not parse esm with swc: Unexpected token `?`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier",
123+
"2:6: Could not parse esm with swc: Expression expected",
124124
"should crash on markdown after import/export w/o blank line"
125125
);
126126

tests/mdx_expression_flow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn mdx_expression_spread() -> Result<(), String> {
245245

246246
assert_eq!(
247247
to_html_with_options("<a {...?} />", &swc).err().unwrap(),
248-
"1:13: Could not parse expression with swc: Unexpected token `?`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier",
248+
"1:13: Could not parse expression with swc: Expression expected",
249249
"should crash on an incorrect spread"
250250
);
251251

tests/mdx_expression_text.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ fn mdx_expression_text_gnostic_core() -> Result<(), String> {
117117
);
118118

119119
assert_eq!(
120-
to_html_with_options("a {var b = \"c\"} d", &swc).err().unwrap(),
121-
"1:4: Could not parse expression with swc: Unexpected token `var`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier",
120+
to_html_with_options("a {var b = \"c\"} d", &swc)
121+
.err()
122+
.unwrap(),
123+
"1:4: Could not parse expression with swc: Expression expected",
122124
"should crash on non-expressions"
123125
);
124126

tests/mdx_jsx_text.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,8 @@ fn mdx_jsx_text_gnostic() -> Result<(), String> {
589589
);
590590

591591
assert_eq!(
592-
to_html_with_options("a <b c={?} /> d", &swc)
593-
.err()
594-
.unwrap(),
595-
"1:16: Could not parse expression with swc: Unexpected token `?`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier",
592+
to_html_with_options("a <b c={?} /> d", &swc).err().unwrap(),
593+
"1:16: Could not parse expression with swc: Expression expected",
596594
"should crash on invalid JS in an attribute value expression"
597595
);
598596

0 commit comments

Comments
 (0)