summaryrefslogtreecommitdiff
path: root/cli/js/tests/unit_test_runner.ts
AgeCommit message (Collapse)Author
2020-05-20move js unit tests to cli/tests (#5678)Ryan Dahl
2020-04-28BREAKING: Remove Deno.symbols namespace (#4936)Nayeem Rahman
2020-04-27BREAKING: remove Deno.runTests() API (#4922)Bartek Iwańczuk
Deno.runTests() interface is not yet good enough to be exposed publicly with stability guarantees. This commit removes public API related to testing: Deno.runTests() and Deno.TestMessage, but keeps them exposed on Deno.internal object so they can be used with "deno test" subcommand.
2020-04-25introduce unstable flag, make a few things unstable (#4892)Ryan Dahl
2020-04-02feat: deno test --filter (#4570)Ryan Dahl
2020-04-01refactor(cli/js/testing): Reduce testing interfaces (#4451)Nayeem Rahman
* Reduce "testing" interfaces * Use a callback instead of a generator for Deno.runTests() * Default RunTestsOptions::reportToConsole to true * Compose TestMessage into a single interface
2020-03-28Update to Prettier 2 and use ES Private Fields (#4498)Kitson Kelly
2020-03-21BREAKING CHANGE Rename Deno.run's args to cmd (#4444)Akshat Agarwal
This is to avoid confusion with Deno.args which does not include the executable to be run.
2020-03-18Fix unit test runner ConnectionReset bug (#4424)Bert Belder
Fixes: #4373
2020-03-17try to handle ConnectionReset error in windows CI for unit tests (#4407)Bartek Iwańczuk
2020-03-16try to fix unit test runner on Windows (#4395)Bartek Iwańczuk
This PR attempts to fix intermittent errors occurring on Windows for "cli/tests/unit_test_runner.ts." Runner has been reworked to create only single TCP listener instead of one listener per worker. Additionally worker doesn't close TCP socket - it waits for parent process to close the socket and only then exits.
2020-03-16refactor: add no-return-await lint rule (#4384)Bartek Iwańczuk
2020-03-15refactor: change test reporter output (#4371)Bartek Iwańczuk
This commit changes output of default test reporter to resemble output from Rust test runner; first the name of running test is printed with "...", then after test has run result is printed on the same line. * Split "Deno.TestEvent.Result" into "TestStart" and "TestEnd"; * changes TestReporter interface to support both events; Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-14Update CLI for unit_test_runner.ts (#4352)Bartek Iwańczuk
* drop server guard before unit test result check To prevent cascading test failures when js_unit_test http server guard is dropped before asserting that tests were successful. This is really a band-aid and doesn't solve underlying issue with http server. * Update CLI for unit_test_runner.ts * Change cli/js/tests/unit_test_runner.ts command line interface to work in 3 modes: - "one-off" - run tests that match permissions of currently running process - "master" - run tests for all possible permission combinations, by spawning subprocesses running in "worker" mode and communicating via TCP socket; requires elevated permissions - "worker" - run tests for set of permissions provided by CLI arg; requires elevated permissions to setup TCP connection to "master"; after initial setup process drops permissions to given set * Support filtering of tests by string passed after "--" CLI arg * Update cli/js/tests/README.md
2020-03-13refactor: unit test runner communicates using TCP socket (#4336)Bartek Iwańczuk
Rewrites "cli/js/unit_test_runner.ts" to communicate with spawned subprocesses using TCP socket. * Rewrite "Deno.runTests()" by factoring out testing logic to private "TestApi" class. "TestApi" implements "AsyncIterator" that yields "TestEvent"s, which is an interface for different types of event occuring during running tests. * Add "reporter" argument to "Deno.runTests()" to allow users to provide custom reporting mechanism for tests. It's represented by "TestReporter" interface, that implements hook functions for each type of "TestEvent". If "reporter" is not provided then default console reporting is used (via "ConsoleReporter"). * Change how "unit_test_runner" communicates with spawned suprocesses. Instead of parsing text data from child's stdout, a TCP socket is created and used for communication. "unit_test_runner" can run in either "master" or "worker" mode. Former is responsible for test discovery and establishing needed permission combinations; while latter (that is spawned by "master") executes tests that match given permission set. * Use "SocketReporter" that implements "TestReporter" interface to send output of tests to "master" process. Data is sent as stringified JSON and then parsed by "master" as structured data. "master" applies it's own reporting logic to output tests to console (by reusing default "ConsoleReporter").
2020-03-10reorg: move js runtime tests to cli/js/tests/ (#4250)Bartek Iwańczuk
All Deno runtime test files were moved to cli/js/tests/ directory. It makes a clear distinction that cli/js/tests/ contains code that is run under Deno runtime as opposed to code in cli/js/ which is used to create bundle and snapshot with "deno_typescript".