Skip to content

Commit

Permalink
chore: Refactor test code to use vscode.languages.getDiagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhant-K-code committed Sep 14, 2024
1 parent f7c151e commit bdac52f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion client/src/test/diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ async function testAutofixSuggestions(docUri: vscode.Uri, expectedDiagnostics: D
assert.deepEqual(actualDiagnostic.range, expectedDiagnostic.range);
assert.equal(actualDiagnostic.severity, expectedDiagnostic.severity);
assert.equal(actualDiagnostic.source, expectedDiagnostic.source);
assert.equal(actualDiagnostic.autofix, expectedDiagnostic.autofix);
if (expectedDiagnostic.autofix) {
assert.equal(actualDiagnostic.autofix, expectedDiagnostic.autofix);
}
});
}
5 changes: 1 addition & 4 deletions client/src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ suite("Should execute command", () => {

await activate(docUri);

const diagnostics = await commands.executeCommand<vscode.Diagnostic[]>(
"vscode.executeDiagnosticProvider",
docUri,
);
const diagnostics = vscode.languages.getDiagnostics(docUri);

const autofixSuggestions = diagnostics
.filter((diagnostic) => diagnostic.severity === vscode.DiagnosticSeverity.Error)
Expand Down

0 comments on commit bdac52f

Please sign in to comment.