summaryrefslogtreecommitdiff
path: root/cli/tools/test/mod.rs
AgeCommit message (Collapse)Author
2024-02-09fix: upgrade to deno_ast 0.33 (#22341)David Sherret
* Uses diagnostics from deno_ast * Real fix for https://github.com/denoland/deno/pull/22310 * Moves `deno lint --json` code here * Upgrades swc Closes #22117 Closes #22109 Closes #21927 Closes #20993
2024-02-07chore: upgrade deno_core to 0.259.0 (#22311)Bartek Iwańczuk
This update brings number of ops available to user code down to 45.
2024-02-05Reland refactor(cli): use new sanitizer for resources (#22226)Matt Mastracci
Originally in #22125 Reverted in #22153 because of #22148 Fixed in deno_core https://github.com/denoland/deno_core/pull/538 Test plan: 1. Check out: https://github.com/poolifier/poolifier-deno.git 2. `PATH=.../deno/target/release/:$PATH deno task test` 3. `ok | 13 passed (188 steps) | 0 failed (18s)`
2024-02-05refactor(cli): Add TestFailureDescription (#22267)Matt Mastracci
Extract zero-risk changes from #22226
2024-02-01refactor: load bytes in deno_graph (#22212)David Sherret
Upgrades deno_graph to 0.64 where deno_graph is now responsible for turning bytes into a string. This is in preparation for Wasm modules.
2024-01-27Revert "refactor(cli): use new sanitizer for resources (#22125)" (#22153)Bartek Iwańczuk
2024-01-26refactor(cli): use new sanitizer for resources (#22125)Matt Mastracci
Step 1 of the Rustification of sanitizers, which unblocks the faster timers. This replaces the resource sanitizer with a Rust one, using the new APIs in deno_core.
2024-01-15refactor: use globbing from deno_config (#21925)David Sherret
2024-01-08perf: skip expanding exclude globs (#21817)David Sherret
We were calling `expand_glob` on our excludes, which is very expensive and unnecessary because we can pattern match while traversing instead. 1. Doesn't expand "exclude" globs. Instead pattern matches while walking the directory. 2. Splits up the "include" into base paths and applicable file patterns. This causes less pattern matching to occur because we're only pattern matching on patterns that might match and not ones in completely unrelated directories.
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-13refactor(cli): update to new deno_core promise/call methods (#21519)Matt Mastracci
2023-12-08feat(lsp): provide quick fixes for specifiers that could be resolved ↵David Sherret
sloppily (#21506)
2023-12-07feat: add suggestions to module not found error messages for file urls (#21498)David Sherret
2023-12-05refactor(cli): refactor bench/test for future module changes (#21460)Matt Mastracci
Extracting some refactorings for the module work that will land in https://github.com/denoland/deno_core/pull/359/
2023-11-22fix: 'Promise was collected' error in REPL/jupyter (#21272)Bartek Iwańczuk
Fixes #20528
2023-10-31feat: deno run --unstable-hmr (#20876)Bartek Iwańczuk
This commit adds `--unstable-hmr` flag, that enabled Hot Module Replacement. This flag works like `--watch` and accepts the same arguments. If HMR is not possible the process will be restarted instead. Currently HMR is only supported in `deno run` subcommand. Upon HMR a `CustomEvent("hmr")` will be dispatched that contains information which file was changed in its `details` property. --------- Co-authored-by: Valentin Anger <syrupthinker@gryphno.de> Co-authored-by: David Sherret <dsherret@gmail.com>
2023-10-19refactor: add WatcherCommunicator helper struct (#20927)Bartek Iwańczuk
This commit introduces "WatcherCommunicator" struct that is used facilitate bi-directional communication between CLI file watcher and the watched function. Prerequisite for https://github.com/denoland/deno/pull/20876
2023-10-05feat(jupyter): support Deno.test() (#20778)Nayeem Rahman
2023-10-05refactor(test): support custom writer in PrettyTestReporter (#20783)Nayeem Rahman
2023-09-27fix(cli): panic with __runtime_js_sources (#20704)Luca Casonato
Also a drive-by cleanup elsewhere (removing unused enum). Fixes #20702
2023-09-17fix(lsp): include JSON modules in local import completions (#20536)Nayeem Rahman
2023-09-15fix(test): share fail fast tracker between threads (#20515)Nayeem Rahman
2023-09-14fix: output traces for op sanitizer in more cases (#20494)Luca Casonato
This adds traces for the "started outside test, closed inside test" case.
2023-09-08fix: empty include in config file excludes all (#20404)Nayeem Rahman
2023-09-06fix(test): apply filter before checking for "only" (#20389)Nayeem Rahman
2023-09-06fix: don't show filtered test suites as running (#20385)Marvin Hagemeister
2023-08-30refactor(lsp): store test definitions in adjacency list (#20330)Nayeem Rahman
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: https://github.com/denoland/vscode_deno/blob/61f08d5a71536a0a5f7dce965955b09e6bd957e1/client/src/testing.ts#L251-L259 and https://github.com/denoland/vscode_deno/issues/900. We should also get more flexibility overall. `TestCollector` is cleaned up, now stores a `&mut TestModule` directly and registers tests as it comes across them with `TestModule::register()`. This method ensures sanity in the redundant data from having both of `TestDefinition::{parent_id,step_ids}`. All of the messy conversions between `TestDescription`, `LspTestDescription`, `TestDefinition`, `TestData` and `TestIdentifier` are cleaned up. They shouldn't have been using `impl From` and now the full list of tests is available to their implementations.
2023-08-27fix(lsp/testing): use full ancestry to compute static id of step (#20297)Nayeem Rahman
Fixes https://github.com/denoland/vscode_deno/issues/656. Test steps were ID'd by a checksum of `[origin, level, step_name]` which is incorrect. Now it's `[origin, ...ancestor_names, step_name]`.
2023-08-26feat(cli/tools): add TAP test reporter (#14390) (#20073)Valentin Anger
This PR adds a test reporter for the [Test Anything Protocol](https://testanything.org). It makes the following implementation decisions: - No TODO pragma, as there is no such marker in `Deno.test` - SKIP pragma for `ignore`d tests - Test steps are treated as TAP14 subtests - Support for this in consumers seems spotty - Some consumers will incorrectly interpret these markers, resulting in unexpected output - Considering the lack of support, and to avoid implementation complexity, subtests are at most one level deep (all test steps are in the same subtest) - To accommodate consumers that use comments to indicate test-suites (unspecced) - The test module path is output as a comment - This is disabled for `--parallel` testing - Failure diagnostics are output as JSON, which is also valid YAML - The structure is not specified, so the format roughly follows the spec example: ``` --- message: "Failed with error 'hostname peebles.example.com not found'" severity: fail found: hostname: 'peebles.example.com' address: ~ wanted: hostname: 'peebles.example.com' address: '85.193.201.85' at: file: test/dns-resolve.c line: 142 ... ```
2023-08-23fix(ext/web): add stream tests to detect v8slice split bug (#20253)Matt Mastracci
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-08-02refactor: use '--reporter' and '--junit-path' flags for 'deno test' (#20031)Bartek Iwańczuk
This commit adds "--reporter" and "--junit-path" flags to "deno test" subcommand instead of using "--dot" and "--junit" flags.
2023-08-02feat(cli): Add dot test reporter (#19804)Bartek Iwańczuk
This commit adds a "dot" reporter to "deno test" subcommand, that can be activated using "--dot" flag. It provides a concise output using: - "." for passing test - "," for ignored test - "!" for failing test User output is silenced and not printed to the console. In non-TTY environments each result is printed on a separate line.
2023-07-27refactor(cli/test): move reporters to a separate directory (#19957)Bartek Iwańczuk
Just a small cleanup that will make #19804 easier.