Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jun 27, 2024
1 parent 0c28f64 commit 1ad3958
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion crates/biome_service/src/file_handlers/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ fn lint(params: LintParams) -> LintResults {
.map(|selector| selector.into())
.collect::<Vec<_>>();

dbg!(&enabled_rules);
let filter = AnalysisFilter {
categories: params.categories,
enabled_rules: Some(enabled_rules.as_slice()),
Expand Down
1 change: 0 additions & 1 deletion crates/biome_service/src/workspace/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,6 @@ impl Workspace for WorkspaceServer {
let (diagnostics, errors, skipped_diagnostics) =
if let Some(lint) = self.get_file_capabilities(&params.path).analyzer.lint {
info_span!("Pulling diagnostics", categories =? params.categories).in_scope(|| {
dbg!("here");
let results = lint(LintParams {
parse,
workspace: &self.workspace(),
Expand Down
14 changes: 11 additions & 3 deletions crates/biome_service/tests/workspace.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[cfg(test)]
mod test {
use biome_analyze::RuleCategories;
use biome_configuration::linter::{RuleGroup, RuleSelector};
use biome_fs::BiomePath;
use biome_js_syntax::{JsFileSource, TextSize};
use biome_service::file_handlers::DocumentFileSource;
Expand Down Expand Up @@ -221,10 +222,17 @@ type User {
},
)
.unwrap();
let result = graphql_file.pull_diagnostics(RuleCategories::all(), 10, vec![], vec![]);
let result = graphql_file.pull_diagnostics(
RuleCategories::all(),
10,
vec![RuleSelector::Rule(
RuleGroup::Nursery,
"useDeprecatedReason",
)],
vec![],
);
assert!(result.is_ok());
let diagnostics = result.unwrap().diagnostics;

dbg!(diagnostics);
assert_eq!(diagnostics.len(), 1)
}
}

0 comments on commit 1ad3958

Please sign in to comment.