Skip to content

Commit

Permalink
tests: use insta for JS parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 25, 2024
1 parent 28a2a6c commit bea304a
Show file tree
Hide file tree
Showing 2,005 changed files with 183,205 additions and 167,108 deletions.
6 changes: 6 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions crates/biome_configuration/src/javascript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ pub struct JavascriptParser {
/// These decorators belong to an old proposal, and they are subject to change.
#[partial(bpaf(hide))]
pub unsafe_parameter_decorators_enabled: bool,

/// Enables parsing of Grit metavariables.
/// Defaults to `false`.
#[partial(bpaf(hide))]
pub grit_metavariables: bool,
}

/// Indicates the type of runtime or transformation used for interpreting JSX.
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_js_analyze/src/utils/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn assert_rename_binding_a_to_b_ok(before: &str, expected: &str) {
let after = root.to_string();
assert_eq!(expected, after.as_str());

assert!(!biome_js_parser::test_utils::has_bogus_nodes_or_empty_slots(&root));
assert!(!biome_test_utils::has_bogus_nodes_or_empty_slots(&root));
}

pub fn assert_rename_ts_binding_a_to_b_ok(before: &str, expected: &str) {
Expand Down Expand Up @@ -71,7 +71,7 @@ pub fn assert_rename_ts_binding_a_to_b_ok(before: &str, expected: &str) {
let after = root.to_string();
assert_eq!(expected, after.as_str());

assert!(!biome_js_parser::test_utils::has_bogus_nodes_or_empty_slots(&root));
assert!(!biome_test_utils::has_bogus_nodes_or_empty_slots(&root));
}

/// Search and renames one binding named "a" to "b".
Expand Down
15 changes: 11 additions & 4 deletions crates/biome_js_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ smallvec = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
expect-test = "1.5.0"
quickcheck = { workspace = true }
quickcheck_macros = { workspace = true }
tests_macros = { workspace = true }
biome_configuration = { workspace = true }
biome_deserialize = { workspace = true }
biome_fs = { workspace = true }
biome_service = { workspace = true }
biome_test_utils = { workspace = true }
expect-test = "1.5.0"
insta = { workspace = true }
quickcheck = { workspace = true }
quickcheck_macros = { workspace = true }
tests_macros = { path = "../tests_macros" }


[features]
schemars = ["dep:schemars"]
Expand Down
10 changes: 2 additions & 8 deletions crates/biome_js_parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,12 @@
mod parser;
#[macro_use]
mod lexer;
pub mod options;
mod parse;
mod prelude;
mod rewrite;
mod span;
mod state;

#[cfg(any(test, feature = "tests"))]
pub mod test_utils;
#[cfg(test)]
mod tests;

pub mod options;
mod prelude;
pub mod syntax;
mod token_source;

Expand Down
67 changes: 0 additions & 67 deletions crates/biome_js_parser/src/test_utils.rs

This file was deleted.

Loading

0 comments on commit bea304a

Please sign in to comment.