mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
d28384c3de
Previously:
```rust
pub struct TestDefinition {
pub id: String,
pub name: String,
pub range: SourceRange,
pub steps: Vec<TestDefinition>,
}
pub struct TestDefinitions {
pub discovered: Vec<TestDefinition>,
pub injected: Vec<lsp_custom::TestData>,
pub script_version: String,
}
```
Now:
```rust
pub struct TestDefinition {
pub id: String,
pub name: String,
pub range: Option<Range>,
pub is_dynamic: bool, // True for 'injected' module, not statically detected but added at runtime.
pub parent_id: Option<String>,
pub step_ids: HashSet<String>,
}
pub struct TestModule {
pub specifier: ModuleSpecifier,
pub script_version: String,
pub defs: HashMap<String, TestDefinition>,
}
```
Storing the test tree as a literal tree diminishes the value of IDs,
even though vscode stores them that way. This makes all data easily
accessible from `TestModule`. It unifies the interface between
'discovered' and 'injected' tests. This unblocks some enhancements wrt
syncing tests between the LSP and extension, such as this TODO:
|
||
---|---|---|
.. | ||
args | ||
bench | ||
cache | ||
js | ||
lsp | ||
napi | ||
npm | ||
ops | ||
schemas | ||
standalone | ||
tests | ||
tools | ||
tsc | ||
util | ||
auth_tokens.rs | ||
build.rs | ||
Cargo.toml | ||
deno.ico | ||
deno_std.rs | ||
emit.rs | ||
errors.rs | ||
factory.rs | ||
file_fetcher.rs | ||
graph_util.rs | ||
http_util.rs | ||
js.rs | ||
main.rs | ||
module_loader.rs | ||
node.rs | ||
README.md | ||
resolver.rs | ||
version.rs | ||
worker.rs |