From b417a89d6c33649bfa3e6fa1b951cd2ad9803299 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 13 Dec 2022 12:16:51 +0400 Subject: Update tests for changes in `swc` --- tests/mdx_esm.rs | 2 +- tests/mdx_expression_flow.rs | 2 +- tests/mdx_expression_text.rs | 6 ++++-- tests/mdx_jsx_text.rs | 6 ++---- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/mdx_esm.rs b/tests/mdx_esm.rs index 7176075..7f76663 100644 --- a/tests/mdx_esm.rs +++ b/tests/mdx_esm.rs @@ -120,7 +120,7 @@ fn mdx_esm() -> Result<(), String> { to_html_with_options("import a from 'b'\n*md*?", &swc) .err() .unwrap(), - "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", + "2:6: Could not parse esm with swc: Expression expected", "should crash on markdown after import/export w/o blank line" ); diff --git a/tests/mdx_expression_flow.rs b/tests/mdx_expression_flow.rs index e549080..7bf39c4 100644 --- a/tests/mdx_expression_flow.rs +++ b/tests/mdx_expression_flow.rs @@ -245,7 +245,7 @@ fn mdx_expression_spread() -> Result<(), String> { assert_eq!( to_html_with_options("", &swc).err().unwrap(), - "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", + "1:13: Could not parse expression with swc: Expression expected", "should crash on an incorrect spread" ); diff --git a/tests/mdx_expression_text.rs b/tests/mdx_expression_text.rs index 0d25105..169aca3 100644 --- a/tests/mdx_expression_text.rs +++ b/tests/mdx_expression_text.rs @@ -117,8 +117,10 @@ fn mdx_expression_text_gnostic_core() -> Result<(), String> { ); assert_eq!( - to_html_with_options("a {var b = \"c\"} d", &swc).err().unwrap(), - "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", + to_html_with_options("a {var b = \"c\"} d", &swc) + .err() + .unwrap(), + "1:4: Could not parse expression with swc: Expression expected", "should crash on non-expressions" ); diff --git a/tests/mdx_jsx_text.rs b/tests/mdx_jsx_text.rs index e403e6d..f548672 100644 --- a/tests/mdx_jsx_text.rs +++ b/tests/mdx_jsx_text.rs @@ -589,10 +589,8 @@ fn mdx_jsx_text_gnostic() -> Result<(), String> { ); assert_eq!( - to_html_with_options("a d", &swc) - .err() - .unwrap(), - "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", + to_html_with_options("a d", &swc).err().unwrap(), + "1:16: Could not parse expression with swc: Expression expected", "should crash on invalid JS in an attribute value expression" ); -- cgit