feat(lsp): add experimental testing API (#13798)

Ref: denoland/vscode_deno#629
This commit is contained in:
Kitson Kelly 2022-03-30 09:59:27 +11:00 committed by GitHub
parent 4a0b2c28a1
commit 061090de7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 2608 additions and 52 deletions

View file

@ -58,7 +58,7 @@ use tokio::sync::mpsc::UnboundedSender;
/// The test mode is used to determine how a specifier is to be tested.
#[derive(Debug, Clone, PartialEq)]
enum TestMode {
pub enum TestMode {
/// Test as documentation, type-checking fenced code blocks.
Documentation,
/// Test as an executable module, loading the module into the isolate and running each test it
@ -163,7 +163,7 @@ struct TestSpecifierOptions {
}
impl TestSummary {
fn new() -> TestSummary {
pub fn new() -> TestSummary {
TestSummary {
total: 0,
passed: 0,
@ -188,7 +188,7 @@ impl TestSummary {
}
}
trait TestReporter {
pub trait TestReporter {
fn report_plan(&mut self, plan: &TestPlan);
fn report_wait(&mut self, description: &TestDescription);
fn report_output(&mut self, output: &TestOutput);
@ -718,7 +718,7 @@ async fn fetch_inline_files(
}
/// Type check a collection of module and document specifiers.
async fn check_specifiers(
pub async fn check_specifiers(
ps: &ProcState,
permissions: Permissions,
specifiers: Vec<(ModuleSpecifier, TestMode)>,