summaryrefslogtreecommitdiff
path: root/runtime/js/40_testing.js
AgeCommit message (Collapse)Author
2022-11-21feat(core): Ability to create snapshots from existing snapshots (#16597)Bartek Iwańczuk
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2022-11-11feat: Stabilize Deno.bench() and 'deno bench' subcommand (#16485)Bartek Iwańczuk
2022-10-25Revert "Revert "refactor(ext/net): clean up variadic network ops (#16… ↵Bartek Iwańczuk
(#16422) …392)" (#16417)" This reverts commit 8e3f825c921b38141afa7a69a0664881c5c94461.
2022-10-25Revert "refactor(ext/net): clean up variadic network ops (#16392)" (#16417)Bartek Iwańczuk
Should fix https://github.com/denoland/deno_std/issues/2807
2022-10-24refactor(ext/net): clean up variadic network ops (#16392)Luca Casonato
Previously `op_net_listen`, `op_net_accept`, and various other ops in ext/net where variadic on the transport. This created a lot of code bloat. This commit updates the code to instead have separate ops for each transport.
2022-09-30refactor(ext/http): remove op_http_read (#16096)Luca Casonato
We can use Resource::read_return & op_read instead. This allows HTTP request bodies to participate in FastStream. To make this work, `readableStreamForRid` required a change to allow non auto-closing resources to be handled. This required some minor changes in our FastStream paths in ext/http and ext/flash.
2022-09-06perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)Divy Srivastava
2022-09-02refactor(test): grab runTests() and runBenchmarks() from __bootstrap (#15420)Nayeem Rahman
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-07-15refactor: allocate IDs for tests (#14729)Nayeem Rahman
2022-06-28fix(test): typo ('finsihed') if text decoder not closed during test (#14996)nkronlage
fix: typo ('finsihed') if text decoder not closed during test
2022-06-24fix: don't error if Deno.bench() or Deno.test() are used in run subcommand ↵Bartek Iwańczuk
(#14946)
2022-06-15chore(cli/cache): Remove CacheType::Declaration (#14873)Nayeem Rahman
2022-06-06fix: Format non-error exceptions (#14604)Nayeem Rahman
This commit adds "Deno.core.setFormatExceptionCallback" which can be used to provide custom formatting for errors. It is useful in cases when user throws something that is non-Error (eg. a string, plain object, etc).
2022-05-30refactor(bench): Allocate IDs for benches (#14757)Nayeem Rahman
2022-05-05feat(test): Show Deno.test() call locations for failures (#14484)Nayeem Rahman
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