Skip to content

Commit

Permalink
fix: deno_ast 0.42 (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Aug 30, 2024
1 parent 45b3bd9 commit 8f5141c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ harness = false

[dependencies]
anyhow = "1.0.64"
deno_ast = { version = "0.41.2", features = ["view"] }
deno_ast = { version = "0.42.0", features = ["view"] }
dprint-core = { version = "0.66.2", features = ["formatting"] }
dprint-core-macros = "0.1.0"
percent-encoding = "2.3.1"
Expand Down
28 changes: 14 additions & 14 deletions src/swc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,20 @@ mod tests {
);
}

#[test]
fn it_should_error_when_var_stmts_sep_by_comma() {
run_fatal_diagnostic_test(
"./test.ts",
"let a = 0, let b = 1;",
concat!(
"Unexpected token `let`. Expected let is reserved in const, let, class declaration at file:///test.ts:1:12\n",
"\n",
" let a = 0, let b = 1;\n",
" ~~~"
),
);
}

fn run_fatal_diagnostic_test(file_path: &str, text: &str, expected: &str) {
let file_path = PathBuf::from(file_path);
assert_eq!(parse_swc_ast(&file_path, text.into()).err().unwrap().to_string(), expected);
Expand All @@ -263,20 +277,6 @@ mod tests {
);
}

#[test]
fn it_should_error_when_var_stmts_sep_by_comma() {
run_non_fatal_diagnostic_test(
"./test.ts",
"let a = 0, let b = 1;",
concat!(
"Expected a semicolon at file:///test.ts:1:16\n",
"\n",
" let a = 0, let b = 1;\n",
" ~"
),
);
}

#[test]
fn it_should_error_for_exected_expr_issue_121() {
run_non_fatal_diagnostic_test(
Expand Down

0 comments on commit 8f5141c

Please sign in to comment.