summaryrefslogtreecommitdiff
path: root/runtime/js/40_testing.js
AgeCommit message (Collapse)Author
2022-04-23fix(bench): eliminate sanitizeExit overhead (#14361)evan
2022-04-20feat(bench): update API, new console reporter (#14305)evan
This commit changes "deno bench" subcommand, by updating the "Deno.bench" API as follows: - remove "Deno.BenchDefinition.n" - remove "Deno.BenchDefintion.warmup" - add "Deno.BenchDefinition.group" - add "Deno.BenchDefintion.baseline" This is done because bench cases are no longer run fixed amount of iterations, but instead they are run until there is difference between subsequent runs that is statistically insiginificant. Additionally, console reporter was rewritten completely, to looks similar to "hyperfine" reporter.
2022-04-16feat(test): use structured data for JavaScript errors in tests (#14287)Bartek Iwańczuk
This commit rewrites test runner to send structured error data from JavaScript to Rust instead of passing strings. This will allow to customize display of errors in test report (which will be addressed in follow up commits).
2022-04-15feat(test): format user code output (#14271)Bartek Iwańczuk
This commit changes "deno test" to better denote user output coming from test cases. This is done by printing "---- output ----" and "---- output end ----" markers if an output is produced. The output from "console" and "Deno.core.print" is captured, as well as direct writes to "Deno.stdout" and "Deno.stderr". To achieve that new APIs were added to "deno_core" crate, that allow to replace an existing resource with a different one (while keeping resource ids intact). Resources for stdout and stderr are replaced by pipes. Co-authored-by: David Sherret <dsherret@gmail.com>
2022-04-13fix(test): Don't error on missing op details (#14184)AEtheve
2022-04-06feat(test): Add "name", "origin" and "parent" to "Deno.TestContext" (#14007)Yongwook Choi
This commit adds following fields to "Deno.TestContext" interface: - name - origin - parent These are prerequisites for supporting snapshot functionality in "std/testing".
2022-03-30feat(lsp): add experimental testing API (#13798)Kitson Kelly
Ref: denoland/vscode_deno#629
2022-03-23fix(bench): require --unstable flag in JavaScript (#14091)Bartek Iwańczuk
2022-03-23fix(test): don't error on missing op details (#14074)Bartek Iwańczuk
2022-03-19refactor: cleanup assert() & AssertionError definitions (#13859)Leo Kettmeir
2022-03-11feat: "deno bench" subcommand (#13713)Bartek Iwańczuk
This commit adds "deno bench" subcommand and "Deno.bench()" API that allows to register bench cases. The API is modelled after "Deno.test()" and "deno test" subcommand. Currently the output is rudimentary and bench cases and not subject to "ops" and "resource" sanitizers. Co-authored-by: evan <github@evan.lol>
2022-02-25feat: deno test --trace-ops (#13770)Bartek Iwańczuk
This commit adds "--trace-ops" flag to "deno test" subcommand. This flag enables saving of stack traces for async ops, that before were always saved. While the feature proved to be very useful it comes with a significant performance hit, it's caused by excessive source mapping of stack frames.
2022-02-16feat(test): improved op sanitizer errors + traces (#13676)Luca Casonato
This commit improves the error messages for the `deno test` async op sanitizer. It does this in two ways: - it uses handwritten error messages for each op that could be leaking - it includes traces showing where each op was started This "async op tracing" functionality is a new feature in deno_core. It likely has a significant performance impact, which is why it is only enabled in tests.
2022-02-07refactor: update runtime code for primordial check for iterators (#13510)Bartek Iwańczuk
2022-02-01refactor: primordials for instanceof (#13527)Bartek Iwańczuk
2022-01-27Revert "refactor: update runtime code for primordial checks for "instanceof" ↵Bartek Iwańczuk
(#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
2022-01-27refactor: update runtime code for primordial checks for "instanceof" (#13497)Bartek Iwańczuk
2022-01-25feat(test): better errors for resource sanitizer (#13296)Luca Casonato
This commit makes the errors produced from the resource sanitizer much more human readable. It does this by using real words rather than our "resource names" when referring to resources, and by giving helpful hints on how to clean up each of the resources.
2022-01-18feat: stabilize test steps API (#13400)David Sherret
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-12-10fix(test): Make the op sanitizer delay macrotask into a queue (#12966)Andreu Botella
Fixes #12945.
2021-11-30fix(test): Improve reliability of `deno test`'s op sanitizer with timers ↵Andreu Botella
(#12934) Although not easy to replicate in the wild, the `deno test` op sanitizer can fail when there are intervals that started before a test runs, since the op sanitizer can end up running in the time between the timer op for an interval's run resolves and the op for the next run starts. This change fixes that by adding a new macrotask callback that will run after the timer macrotask queue has drained. This ensures that there is a timer op if there are any timers which are unresolved by the time the op sanitizer runs.
2021-11-29Revert "fix(test): Improve reliability of `deno test`'s op sanitizer with ↵Bartek Iwańczuk
timers (#12908)" (#12929) This reverts commit d335343a79afbcfe719109af510fe7a1dd0df2e8.
2021-11-28fix(test): Improve reliability of `deno test`'s op sanitizer with timers ↵Andreu Botella
(#12908) Although not easy to replicate in the wild, the `deno test` op sanitizer can fail when there are intervals that started before a test runs, since the op sanitizer can end up running in the time between the timer op for an interval's run resolves and the op for the next run starts. This change fixes that by adding a new macrotask callback that will run after the timer macrotask queue has drained. This ensures that there is a timer op if there are any timers which are unresolved by the time the op sanitizer runs.
2021-11-23feat(test): Add more overloads for "Deno.test" (#12749)Bartek Iwańczuk
This commit adds 4 more overloads to "Deno.test()" API. ``` // Deno.test(function testName() { }); export function test(fn: (t: TestContext) => void | Promise<void>): void; // Deno.test("test name", { only: true }, function() { }); export function test( name: string, options: Omit<TestDefinition, "name">, fn: (t: TestContext) => void | Promise<void>, ): void; // Deno.test({ name: "test name" }, function() { }); export function test( options: Omit<TestDefinition, "fn">, fn: (t: TestContext) => void | Promise<void>, ): void; // Deno.test({ only: true }, function testName() { }); export function test( options: Omit<TestDefinition, "fn" | "name">, fn: (t: TestContext) => void | Promise<void>, ): void; ```
2021-11-20fix(test): do not throw on error.errors.map (#12810)Yacine Hmito
In tests, the function to format errors would assume that any error with a property `errors` would be an `AggregateError`, and therefore the property `errors` would contain an error. This is not necessarily the case.
2021-10-13fix(runtime/ops/worker_host): move permission arg parsing to Rust (#12297)Nayeem Rahman
2021-10-13chore: fix flaky steps_invalid_usage tests (#12422)David Sherret
2021-10-12chore: upgrade crates based on deno ast 0.3 (#12403)David Sherret
2021-10-11feat: provide ops details for ops sanitizer failures (#12188)Casper Beyer
2021-10-11feat(unstable/test): imperative test steps API (#12190)David Sherret
2021-10-10refactor(metrics): move to core (#12386)Aaron O'Mullan
Avoids overhead of wrapping ops (and allocs when inspecting async-op futures)
2021-09-30fix(runtime/testing): format aggregate errors (#12183)Casper Beyer
2021-09-05refactor(testing): use discrete report functions (#11917)Casper Beyer
2021-09-04refactor(testing): redirect console output via reporter (#11911)Casper Beyer
This feeds console output to the reporter and handles silencing there instead of in the JavaScript code.
2021-07-14refactor(cli/tools/test_runner): split reporter into distinct stages (#11395)Casper Beyer
This splits up the reporter into smaller functions, one for each distinct event that happens during the testing process.
2021-07-14refactor(runtime): apply permissions as a hook during registration (#11347)Casper Beyer
2021-07-05feat(test): add --shuffle flag to randomize test ordering (#11163)Casper Beyer
2021-07-05fix(runtime): ignored tests should not cause permission changes (#11278)Casper Beyer
2021-07-05refactor(runtime): reduce duplication in test harness (#11274)Casper Beyer
2021-07-04refactor: use primordials in runtime/, part2 (#11248)Bartek Iwańczuk
2021-05-18chore: update deno_lint binary used in CI to v0.5.0 (#10652)Yusuke Tanaka
2021-04-28feat(test): run test modules in parallel (#9815)Casper Beyer
This commit adds support for running test in parallel. Entire test runner functionality has been rewritten from JavaScript to Rust and a set of ops was added to support reporting in Rust. A new "--jobs" flag was added to "deno test" that allows to configure how many threads will be used. When given no value it defaults to 2.
2021-04-25feat(cli): add test permissions to Deno.test (#10188)Casper Beyer
This commits adds adds "permissions" option to the test definitions which allows tests to run with different permission sets than the process's permission. The change will only be in effect within the test function, once the test has completed the original process permission set is restored. Test permissions cannot exceed the process's permission. You can only narrow or drop permissions, failure to acquire a permission results in an error being thrown and the test case will fail.
2021-03-12refactor: move Console to op_crates/console (#9770)Luca Casonato
2021-02-24feat: add exit sanitizer to Deno.test (#9529)Casper Beyer
This adds an exit sanitizer to ensure that code being tested or dependencies of that code can't accidentally call "Deno.exit" leading to partial test runs and false results.
2021-02-21fix(runtime/testing): false positive for timers when an error is thrown (#9553)Casper Beyer
2021-02-04chore: use strict mode for internal runtime, core, and op_crates js (#9391)Developing
2021-01-17chore: Enforce ban-untagged-todo lint rule (#9135)Bartek Iwańczuk
2021-01-11chore: update copyright to 2021 (#9092)Yusuke Tanaka