summaryrefslogtreecommitdiff
path: root/cli/tests
AgeCommit message (Collapse)Author
2023-01-23refactor: Move lockfile to a separate crate (#17503)Bartek Iwańczuk
Moves the lockfile implementation to a separate crate so other projects like Deploy can use it as well.
2023-01-19feat(runtime): add bigint to seek typings (#17314)Leo Kettmeir
2023-01-18refactor(cli): Integrate standalone mode cert handling into `Flags` (#17419)Andreu Botella
The way the standalone mode handles the `--cert` flag is different to all other modes. This is because `--cert` takes a path to the certificate file, which is directly added to the root cert store; except for compile mode, where its byte contents are stored in the standalone metadata, and they are added to the root cert store after the `ProcState` is created. This change instead changes `Flags::ca_file` (an `Option<String>`) into `Flags::ca_data`, which can represent a `String` file path or a `Vec<u8>` with the certificate contents. That way, standalone mode can create a `ProcState` whose root cert store alreay contains the certificate. This change also adds a tests for certificates in standalone mode, since there weren't any before. This refactor will help with implementing web workers in standalone mode in the future.
2023-01-16chore: update dlint to v0.37.0 for GitHub Actions (#17295)Kenta Moriuchi
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
2023-01-16fix(cli/fmt): show filepath for InvalidData error (#17361)Leo Kettmeir
2023-01-15chore: update std submodule and its imports (#17408)Asher Gomez
2023-01-14chore: use rustfmt imports_granularity option (#17421)Divy Srivastava
Closes https://github.com/denoland/deno/issues/2699 Closes https://github.com/denoland/deno/issues/2347 Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not need to switch the cargo toolchain to nightly. Do we care about formatting stability of our codebase across Rust versions? (I don't)
2023-01-15fix(ext/fetch) Fix request clone error in flash server (#16174)Isaiah Gamble
2023-01-14fix(ext/flash): Correctly handle errors for chunked responses (#17303)Kamil Ogórek
The leading cause of the problem was that `handleResponse` has `tryRespondChunked` passed as an argument, which in turn is implemented as a call to `core.ops.op_try_flash_respond_chuncked`, that throws in the repro code. `handleResponse` was not handled correctly, as it not returned any value, and had no `catch` attached to it. It also effectively was never correctly handled inside two other blocks with `resp.then` and `PromisePrototypeCatch(PromisePrototypeThen(resp, "..."))` as well, as it just short-circuited the promise with an empty resolve, instead of relying on the last `(async () => {})` block. This change makes `handleResponse` return a correct value and attach `onError` handler to the "non-thenable" variant of response handling code.
2023-01-14fix(runtime/fs): preserve permissions in copyFileSync for macOS (#17412)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/16921
2023-01-14fix(npm): use original node regex in npm resolution (#17404)Kiryl Dziamura
Fixes regex for matching conditional exports in a package. Updated to the same regex Node.js uses.
2023-01-13fix(permissions): lock stdio streams when prompt is shown (#17392)Bartek Iwańczuk
This commit changes permission prompt to lock stdio streams when prompt is shown.
2023-01-13tests: Disable flaky flash_shutdown test (#17390)Bartek Iwańczuk
2023-01-13chore: add `copyright_checker` tool and add the missing copyright (#17285)Yiyu Lin
2023-01-13tests: move integration tests to a single module (#17380)Bartek Iwańczuk
Effectively reverts changes done in https://github.com/denoland/deno/pull/16816
2023-01-12Revert "test: fix flaky deno_land_unsafe_ssl test (#17357)" (#17368)Bartek Iwańczuk
This reverts commit ee2c6cb04af232be672b31b81f7c377b2f571267. Closes https://github.com/denoland/deno/issues/17359
2023-01-12fix: check if BroadcastChannel is open before sending (#17366)Leo Kettmeir
Fixes #16978
2023-01-12feat: allow passing a ReadableStream to Deno.writeFile/Deno.writeTextFile ↵Leo Kettmeir
(#17329) Closes #13229
2023-01-12test: fix flaky deno_land_unsafe_ssl test (#17357)Bartek Iwańczuk
2023-01-11fix: don't panic on resolveDns if unsupported record type is specified (#17336)Leo Kettmeir
Fixes #14373
2023-01-10fix(watch): preserve `ProcState::file_fetcher` between restarts (#15466)Nayeem Rahman
This commit changes "ProcState" to store "file_fetcher" field in an "Arc", allowing it to be preserved between restarts and thus keeping the state alive between the restarts. File watchers for "deno test" and "deno bench" now reset "ProcState" between restarts.
2023-01-10fix(npm): allow to read package.json if permissions are granted (#17209)Bartek Iwańczuk
This commit changes signature of "deno_core::ModuleLoader::resolve" to pass an enum indicating whether or not we're resolving a specifier for dynamic import. Additionally "CliModuleLoader" was changes to store both "parent permissions" (or "root permissions") as well as "dynamic permissions" that allow to check for permissions in top-level module load an dynamic imports. Then all code paths that have anything to do with Node/npm compat are now checking for permissions which are passed from module loader instance associated with given worker.
2023-01-09feat(runtime/os): add `Deno.env.has()` (#17315)Leo Kettmeir
2023-01-08fix(install): should always include `--no-config` in shim unless `--config` ↵David Sherret
is specified (#17300) Closes #17294
2023-01-07refactor(permissions): add PermissionsContainer struct for internal ↵Bartek Iwańczuk
mutability (#17134) Turns out we were cloning permissions which after prompting were discarded, so the state of permissions was never preserved. To handle that we need to store all permissions behind "Arc<Mutex<>>" (because there are situations where we need to send them to other thread). Testing and benching code still uses "Permissions" in most places - it's undesirable to share the same permission set between various test/bench files - otherwise granting or revoking permissions in one file would influence behavior of other test files.
2023-01-06fix(npm): handle declaration file resolution where packages incorrectly ↵David Sherret
define "types" last in "exports" (#17290) Closes #17279
2023-01-04fix: upgrade deno_ast to 0.23 (#17269)David Sherret
Closes #17172 Closes #15669 Closes #8529
2023-01-03fix(permissions): process `URL` in `Deno.FfiPermissionDescriptor.path` for ↵Asher Gomez
`revoke()` and `request()` (#17094) Previously, `Deno.permissions.[revoke|request]()` wouldn't correctly process the `path: URL` when `name` was `ffi`. This change fixes that behaviour and adds a new function, `formDescriptor()`, to ensure `URL` arguments are consistently handled across `Deno.permissions.[query|revoke|request]()`.
2023-01-03fix(cli): bundle command support shebang file (#17113)Fenix
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-30fix(lsp): less agressive completion triggers (#17225)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/17056 Closes https://github.com/denoland/deno/issues/17055
2022-12-29fix(lsp): completions for private variables (#17220)Bartek Iwańczuk
2022-12-29fix(lsp): "Add all missing imports" uses correct specifiers (#17216)Bartek Iwańczuk
This commit fixes "Add all missing imports" quick fix; before it was replacing all occurrences with the same specifier. Now every line returned from TSC is processed individually.
2022-12-28feat(unstable): Add Deno.Conn.ref()/unref() (#17170)Bartek Iwańczuk
This commit adds "Deno.Conn.ref()" and "Deno.Conn.unref()" methods. These methods can be used to make connection block or not block the event loop from finishing. Refing/unrefing only influences "read" operations - ie. scheduling writes to a connection _do_ keep event loop alive. Required for https://github.com/denoland/deno/issues/16710
2022-12-27feat(unstable): Add "Deno.osUptime()" API (#17179)Kamil Ogórek
This PR adds support for `Deno.osUptime` which reports number of seconds since os was booted. It will allow us to be compatible with Node's `os.uptime` - https://nodejs.org/api/os.html#osuptime Partially based on https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
2022-12-23fix(core): run macrotasks and next ticks after polling dynamic imports (#17173)Bartek Iwańczuk
This commit fixes handling of rejected promises in dynamic imports evaluation. Previously we were running callbacks for next ticks and macrotasks _before_ polling dynamic imports and checked for unhandled rejections immediately after. This is wrong, as `unhandledrejection` event is dispatched and its callbacks are run as macrotasks. This commit changes order of actions performed by the event loop to following: - poll async ops - poll dynamic imports - run next tick callbacks - run macrotask callbacks - check for unhandled promise rejections
2022-12-23fix(ext/fetch): Guard against invalid URL before its used by reqwest (#17164)Kamil Ogórek
2022-12-21fix(core): Do not print errors prop for non-AggregateError errors (#17123)Kamil Ogórek
This commit fixes formatting of JSError with "errors" property. Before this commit all instances of "Error" were treated as if they were "AggregateError" if they had "errors" property. After this commit only actual instances of "AggregateError" are formatted in such a way, while instances of "Error" that have "errors" property are formatted without showing details of "errors".
2022-12-20fix(lsp/format): language formatter used should be based on language id (#17148)David Sherret
Closes #11897
2022-12-20fix: ignore local lockfile for deno install and uninstall (#17145)David Sherret
Closes #17116
2022-12-20fix(ext/http): close stream on resp body error (#17126)Luca Casonato
Previously, errored streaming response bodies did not cause the HTTP stream to be aborted. It instead caused the stream to be closed gracefully, which had the result that the client could not detect the difference between a successful response and an errored response. This commit fixes the issue by aborting the stream on error.
2022-12-19fix(cli): allow for specifying `noErrorTruncation` compiler option (#17127)Kamil Ogórek
Fixes https://github.com/denoland/deno/issues/16568
2022-12-19fix: display URL in invalid URL error (#17128)Leo Kettmeir
2022-12-19fix(cli): do not clear screen for non-TTY environments in watch mode (#17129)Kamil Ogórek
2022-12-19fix(npm): conditional exports with --node-modules-dir (#17111)Bartek Iwańczuk
This commit fixes conditional exports in `require()` implementation if `--node-modules-dir` flag is used.
2022-12-19test(ext/fetch): fix test in release mode (#17125)Luca Casonato
2022-12-19fix(ext/fetch): handle errors in req body stream (#17081)Luca Casonato
Right now an error in a request body stream causes an uncatchable global promise rejection. This PR fixes this to instead propagate the error correctly into the promise returned from `fetch`. It additionally fixes errored readable stream bodies being treated as successfully completed bodies by Rust.
2022-12-17fix(runtime): `Deno.memoryUsage().rss` should return correct value (#17088)David Sherret
This commit changes implementation of "Deno.memoryUsage()" to return correct value for "rss" field. To do that we implement a specialized function per os to retrieve this information.
2022-12-17chore: update to Rust 1.66.0 (#17078)linbingquan
2022-12-17fix(lint): column number for pretty reporting was off by 1 (#17107)David Sherret
Closes #17086