summaryrefslogtreecommitdiff
path: root/cli/tests
AgeCommit message (Collapse)Author
2020-02-29refactor(cli/js): Replace constructError() with getErrorClass() (#4189)Nayeem Rahman
Flattens dispatch error handling to produce one less useless stack frame on op errors.
2020-02-28rewrite permission revoke test as integration test (#4164)Bartek Iwańczuk
2020-02-28Support TypeScript eval through `deno eval -T` flag (#4141)Kevin (Kun) "Kassimo" Qian
2020-02-27Return non-zero exit code on malformed stdin fmt (#4163)Ryan Dahl
2020-02-27feat: Support types compiler option in compiler APIs (#4155)Kitson Kelly
Handles `types` in the compiler APIs to make it easier to supply external type libraries.
2020-02-26Bundles can be sync or async based on top level await (#4124)Kitson Kelly
Previously, bundles always utilised top level await, even if the bundled modules didn't require top level await. Now, analysis of the bundle is done and if none of the bundled modules are asynchronously executed, then the bundle as a whole will be synchronously executed. Fixes #4055 Fixes #4123
2020-02-26DenoFlags -> Flags (#4136)Ryan Dahl
2020-02-26tty: Deno.setRaw(rid, mode) to turn on/off raw mode (#3958)Kevin (Kun) "Kassimo" Qian
2020-02-25Port permission_prompt_tests to Rust (#4129)João Souto
2020-02-25upgrade: TypeScript 3.8 (#4100)Kitson Kelly
2020-02-25fix: Resolve makeTemp* paths from CWD (#4104)Nayeem Rahman
2020-02-25Fix issues with JavaScript importing JavaScript. (#4120)Kitson Kelly
Fixes #3852 Fixes #4117
2020-02-24port tools/repl_test.py to Rust (#4096)João Souto
ref #2988
2020-02-24fix: createSecKey logic (#4063)Suguru Motegi
2020-02-23feat: support brotli compression for fetch API (#4082)EnokMan
2020-02-21refactor: remove unneeded ErrorKinds (#3936)Bartek Iwańczuk
2020-02-21fix: add io ops to worker to fix fetch (#4054)Bartek Iwańczuk
2020-02-19fix: mis-detecting imports on JavaScript when there is no checkJs (#4040)Kitson Kelly
This PR fixes an issue where we recursively analysed imports on plain JS files in the compiler irrespective of "checkJs" being true. This caused problems where when analysing the imports of those files, we would mistake some import like structures (AMD/CommonJS) as dependencies and try to resolve the "modules" even though the compiler would not actually look at those files.
2020-02-19fix: emit when bundle contains single module (#4042)Kitson Kelly
Fixes #4031 When a bundle contains a single module, we were incorrectly determining the module name, resulting in a non-functional bundle. This PR corrects that determination.
2020-02-19Enable TS strict mode by default (#3899)Maximilien Mellen
Fixes #3324 Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-02-19refactor: rewrite HTTP cache for file fetcher (#4030)Bartek Iwańczuk
2020-02-19Support loading additional TS lib files (#3863)Kitson Kelly
Fixes #3726 This PR provides support for referencing other lib files (like lib.dom.d.ts that are not used by default in Deno.
2020-02-17feat: add --cert flag for http client (#3972)geoFlux
2020-02-16Fix issue with detecting AMD like imports (#4009)Kitson Kelly
2020-02-13Clean up fmt flags and path handling (#3988)Ryan Dahl
2020-02-12Improvements to bundling. (#3965)Kitson Kelly
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being re-exported. Fixes #2553 Fixes #3559 Fixes #3751 Fixes #3825 Refs #3301
2020-02-11refactor: Use PathBuf for paths in flag parsing and whitelists (#3955)Nayeem Rahman
* Use PathBuf for DenoSubcommand::Bundle's out_file * Use PathBuf for DenoSubcommand::Format's files * Use PathBuf for DenoSubcommand::Install's dir * Use PathBuf for read/write whitelists
2020-02-11workers: basic event loop (#3828)Bartek Iwańczuk
* establish basic event loop for workers * make "self.close()" inside worker * remove "runWorkerMessageLoop() - instead manually call global function in Rust when message arrives. This is done in preparation for structured clone * refactor "WorkerChannel" and use distinct structs for internal and external channels; "WorkerChannelsInternal" and "WorkerHandle" * move "State.worker_channels_internal" to "Worker.internal_channels" * add "WorkerEvent" enum for child->host communication; currently "Message(Buf)" and "Error(ErrBox)" variants are supported * add tests for nested workers * add tests for worker throwing error on startup
2020-02-09fmt: `deno fmt -` formats stdin and print to stdout (#3920)Kevin (Kun) "Kassimo" Qian
2020-02-08install: add --force flag and remove yes/no prompt (#3917)Kevin (Kun) "Kassimo" Qian
2020-02-07Remove conditionals from installer (#3909)Ryan Dahl
2020-02-06fix 015_duplicate_parallel_import (#3904)Ryan Dahl
2020-02-05fix: basic web worker message passing (#3893)Ryan Dahl
Removes OP_HOST_GET_WORKER_LOADED, OP_HOST_POLL_WORKER, OP_HOST_RESUME_WORKER and ready/messageBuffer in cli/js/workers.ts.
2020-02-04refactor: port fetch test to rust (#3887)Luka Hartwig
2020-02-04refactor: CLI subcommands and argv (#3886)Bartek Iwańczuk
2020-02-04Do not encode files loaded from network as utf8 (#3856)Tilman Roeder
2020-02-04reenable some tests (#3882)Bartek Iwańczuk
2020-02-03refactor: Use Tokio's single-threaded runtime (#3844)Ryan Dahl
This change simplifies how we execute V8. Previously V8 Isolates jumped around threads every time they were woken up. This was overly complex and potentially hurting performance in a myriad ways. Now isolates run on their own dedicated thread and never move. - blocking_json spawns a thread and does not use a thread pool - op_host_poll_worker and op_host_resume_worker are non-operational - removes Worker::get_message and Worker::post_message - ThreadSafeState::workers table contains WorkerChannel entries instead of actual Worker instances. - MainWorker and CompilerWorker are no longer Futures. - The multi-threaded version of deno_core_http_bench was removed. - AyncOps no longer need to be Send + Sync This PR is very large and several tests were disabled to speed integration: - installer_test_local_module_run - installer_test_remote_module_run - _015_duplicate_parallel_import - _026_workers
2020-02-02Remove //tests symlink (#3849)Luka Hartwig
2020-01-31Add support for multiple files in fetch command (#3845)Tim Ermilov
2020-01-31chore: remove std/installer, port installer tests to Rust (#3843)Bartek Iwańczuk
2020-01-30Remove --current-thread flag (#3830)Ryan Dahl
This flag was added to evaluate performance relative to tokio's threaded runtime. Although it's faster in the HTTP benchmark, it's clear the runtime is not the only perf problem. Removing this flag will simplify further refactors, in particular adopting the #[tokio::main] macro. This will be done in a follow up. Ultimately we expect to move to the current thread runtime with Isolates pinned to specific threads, but that will be a much larger refactor. The --current-thread just complicates that effort.
2020-01-29feat: dprint formatter (#3820)Bartek Iwańczuk
* rewrite fmt_test in Rust, remove tools/fmt_test.py * remove //std/prettier
2020-01-29workers: proper TS libs, more spec-compliant APIs (#3812)Bartek Iwańczuk
* split lib.deno_main.d.ts into: - lib.deno.shared_globals.d.ts - lib.deno.window.d.ts - lib.deno.worker.d.ts * remove no longer used libs: - lib.deno_main.d.ts - lib.deno_worker.d.ts * change module loading to use proper TS library for compilation * align to Worker API spec: - Worker.terminate() - self.close() - self.name
2020-01-27dx: descriptive permission errors (#3808)Bartek Iwańczuk
Before: ``` ▶ target/debug/deno https://deno.land/std/examples/echo_server.ts error: Uncaught PermissionDenied: run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendSync ($deno$/dispatch_json.ts:67:10) at listen ($deno$/net.ts:170:15) at https://deno.land/std/examples/echo_server.ts:4:23 ``` ``` ▶ target/debug/deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd error: Uncaught PermissionDenied: run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendAsync ($deno$/dispatch_json.ts:91:10) ``` After: ``` ▶ target/debug/deno https://deno.land/std/examples/echo_server.ts error: Uncaught PermissionDenied: network access to "0.0.0.0:8080", run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendSync ($deno$/dispatch_json.ts:67:10) at listen ($deno$/net.ts:170:15) at https://deno.land/std/examples/echo_server.ts:4:23 ``` ``` ▶ target/debug/deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd error: Uncaught PermissionDenied: read access to "/etc/passwd", run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendAsync ($deno$/dispatch_json.ts:91:10) ```
2020-01-26Improve support of type definitions (#3755)Kitson Kelly
2020-01-26lock: support lock-write for fetch command (#3787)Kevin (Kun) "Kassimo" Qian
2020-01-26feat: make eval support --v8-flags=... (#3797)Ben Noordhuis
Closes #3796
2020-01-25refactor: Modules and Loader trait (#3791)Bartek Iwańczuk
* move is_dyn_import argument from Loader::resolve to Loader::load - it was always kind of strange that resolve() checks permissions. * change argument type from &str to &ModuleSpecifier where applicable
2020-01-21refactor: split worker and worker host logic (#3722)Bartek Iwańczuk
* split ops/worker.rs into ops/worker_host.rs and ops/web_worker.rs * refactor js/workers.ts and factor out js/worker_main.ts - entry point for WebWorker runtime * BREAKING CHANGE: remove support for blob: URL in Worker * BREAKING CHANGE: remove Deno namespace support and noDenoNamespace option in Worker constructor * introduce WebWorker struct which is a stripped down version of cli::Worker