summaryrefslogtreecommitdiff
path: root/tests/specs
AgeCommit message (Collapse)Author
2024-09-23feat(fmt): support vto and njk extensions (#25831)Óscar Otero
Fixes #25802 markup_fmt plugin supports some HTML-like formats like Angular, Jinja, Twig, Nunjucks or Vento, that are not supported by `deno fmt`. This PR adds support for the extensions `njk` (Nunjucks) and `vto` (Vento). Angular doesn't have a custom extension (it uses `html` afaik) and Jinja and Twig are template engines written in Python and PHP respectively so it doesn't make sense to be supported by Deno.
2024-09-23feat(fmt): stabilize CSS, HTML and YAML formatters (#25753)Bartek Iwańczuk
This commits stabilizes CSS, HTML and YAML formatters in `deno fmt`. It is no longer required to use either of these flags: - `--unstable-css` - `--unstable-html` - `--unstable-yaml` Or these `unstable` options in the config file: - `fmt-css` - `fmt-html` - `html-yaml`
2024-09-23tests: update specs::cache::package_json (#25827)Satya Rohith
Towards https://github.com/denoland/deno/issues/25241
2024-09-23tests: enable auto_discovered tests of run/no_deno_json (#25821)Satya Rohith
Towards https://github.com/denoland/deno/issues/25241
2024-09-23feat: make 'globalThis.location' a configurable property (#25812)Bartek Iwańczuk
This commit changes `globalThis.location` property to be configurable so that packages wanting to override it (or delete it) work properly. Towards https://github.com/denoland/deno/issues/23882 This change makes reproduction from https://github.com/denoland/deno/issues/23882#issuecomment-2340783437 pass properly.
2024-09-23feat: Show hints when using `window` global (#25805)Bartek Iwańczuk
This commit adds better handling for terminal errors when `window` global is used. This global is removed in Deno 2, and while we have lints to help with that, an information and hints are helpful to guide users to working code. Ref https://github.com/denoland/deno/issues/25797
2024-09-21fix(node): Include "node" condition during CJS re-export analysis (#25785)Nathan Whitaker
Fixes #25777. We were missing the "node" condition, so we were resolving to the wrong conditional export, causing our analysis to be incorrect.
2024-09-20refactor(tests): migrate npm itests to specs (#25764)Satya Rohith
Towards https://github.com/denoland/deno/issues/25241
2024-09-20test: make specs::test::doc_success less flaky (#25765)Bartek Iwańczuk
Missed this line in https://github.com/denoland/deno/pull/25726
2024-09-20fix(coverage): ignore urls from doc testing (#25736)Yoshiya Hinosawa
2024-09-19fix: cjs resolution cases (#25739)snek
Fixes cjs modules being loaded as esm.
2024-09-19fix(node): Don't error out if we fail to statically analyze CJS re-export ↵Nathan Whitaker
(#25748) Fixes rsbuild running in deno. You can look at the test to see what was failing, the gist is that we were trying to statically analyze the re-exports of a CJS script, and if we couldn't find the source for the re-exported file we would fail. Instead, we should just treat these as if they were too dynamic to analyze, and let it fail (or succeed) at runtime. This aligns with node's behavior.
2024-09-19test: make specs::test::doc_success less flaky (#25726)Bartek Iwańczuk
On Windows some of these steps were taking more than 1s
2024-09-19fix: don't include extensionless files in file collection for lint & fmt by ↵Leo Kettmeir
default (#25721) When using the `ext` flag, it will still attempt formatting them with the provided extension
2024-09-18feat: suggest `deno install --entrypoint` instead of `deno cache` (#25228)Asher Gomez
Hides `deno cache` from `--help` output. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-18feat: default to TS for file extension and support ext flag in more ↵Leo Kettmeir
scenarios (#25472) Closes #11220 Currently does lint, fmt, and repl
2024-09-18feat: improve warnings for deprecations and lifecycle script for npm ↵Bartek Iwańczuk
packages (#25694) This commit improves warning messages for deprecated npm packages and packages that rely on lifecycle script.
2024-09-18feat(lint): add `no-process-global` lint rule (#25709)Divy Srivastava
Closes https://github.com/denoland/deno/issues/25679
2024-09-18feat: require jsr prefix for `deno install` and `deno add` (#25698)Leo Kettmeir
2024-09-18fix(flags): don't treat empty run command as task subcommand (#25708)Leo Kettmeir
2024-09-18feat(check): turn on noImplicitOverride (#25695)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/11836 Ref https://github.com/denoland/deno/issues/25162
2024-09-18tests: fix upgrade canary test (#25706)Luca Casonato
2024-09-18tests: re-enable upgrade tests (#25680)Luca Casonato
2024-09-17feat(cli): evaluate code snippets in JSDoc and markdown (#25220)Yusuke Tanaka
This commit lets `deno test --doc` command actually evaluate code snippets in JSDoc and markdown files. ## How it works 1. Extract code snippets from JSDoc or code fences 2. Convert them into pseudo files by wrapping them in `Deno.test(...)` 3. Register the pseudo files as in-memory files 4. Run type-check and evaluation We apply some magic at the step 2 - let's say we have the following file named `mod.ts` as an input: ````ts /** * ```ts * import { assertEquals } from "jsr:@std/assert/equals"; * * assertEquals(add(1, 2), 3); * ``` */ export function add(a: number, b: number) { return a + b; } ```` This is virtually transformed into: ```ts import { assertEquals } from "jsr:@std/assert/equals"; import { add } from "files:///path/to/mod.ts"; Deno.test("mod.ts$2-7.ts", async () => { assertEquals(add(1, 2), 3); }); ``` Note that a new import statement is inserted here to make `add` function available. In a nutshell, all items exported from `mod.ts` become available in the generated pseudo file with this automatic import insertion. The intention behind this design is that, from library user's standpoint, it should be very obvious that this `add` function is what this example code is attached to. Also, if there is an explicit import statement like `import { add } from "./mod.ts"`, this import path `./mod.ts` is not helpful for doc readers because they will need to import it in a different way. The automatic import insertion has some edge cases, in particular where there is a local variable in a snippet with the same name as one of the exported items. This case is addressed by employing swc's scope analysis (see test cases for more details). ## "type-checking only" mode stays around This change will likely impact a lot of existing doc tests in the ecosystem because some doc tests rely on the fact that they are not evaluated - some cause side effects if executed, some throw errors at runtime although they do pass the type check, etc. To help those tests gradually transition to the ones runnable with the new `deno test --doc`, we will keep providing the ability to run type-checking only via `deno check --doc`. Additionally there is a `--doc-only` option added to the `check` subcommand too, which is useful when you want to type-check on code snippets in markdown files, as normal `deno check` command doesn't accept markdown. ## Demo https://github.com/user-attachments/assets/47e9af73-d16e-472d-b09e-1853b9e8f5ce --- Closes #4716
2024-09-18feat: update warning message for --allow-run with no list (#25693)Bartek Iwańczuk
Ref https://github.com/denoland/deno/pull/25215#discussion_r1762064605
2024-09-16feat: warn when using `--allow-run` with no allow list (#25215)David Sherret
2024-09-16fix(npm): better error handling for remote npm deps (#25670)David Sherret
* https://github.com/denoland/deno_npm/pull/68
2024-09-16refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)David Sherret
This makes the permission system more versatile.
2024-09-16chore: deprecate test itests (#25512)HasanAlrimawi
This PR is part of #22907 --------- Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-16chore: deprecate lint itests (#25655)HasanAlrimawi
2024-09-16chore: move info itests (#25659)Mohammad Sulaiman
2024-09-16test: rewrite some ignored tests to spec tests (#25652)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/25241 Rewritten these tests: - check::package_json_basic - check::package_json_fail_check - check::package_json_with_deno_json - info::package_json_basic - test::package_json_basic - run::package_json_auto_discovered_for_npm_binary - run::package_json_with_deno_json
2024-09-16chore: deprecate node compat itests (#25573)Mohammad Sulaiman
2024-09-16chore: cleanup remaining `internals.future` code (#25624)Asher Gomez
2024-09-15fix(cli): `deno task` exit with status 0 (#25637)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/25632 Exit code 1 indiciates some sort of failure but `deno task` (without arguments) is used to list available commands. --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-09-14feat: TypeScript 5.6 and `npm:@types/node@22` (#25614)David Sherret
2024-09-13chore: enable `specs::run::workspaces::explicit_import_map` test (#25611)Asher Gomez
Towards #25241
2024-09-12feat(serve): Support second parameter in deno serve (#25606)Nathan Whitaker
Closes #24099
2024-09-12feat: stabilize `Deno.createHttpClient()` (#25569)Asher Gomez
Closes #25518
2024-09-11chore: deprecate task itests (#25558)HasanAlrimawi
This PR is part of #22907
2024-09-11feat(upgrade): better error message on failure (#25503)Bartek Iwańczuk
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-09-11BREAKING(net): remove `Deno.[Tls]Listener.prototype.rid` (#25556)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-10BREAKING(net): remove ↵Asher Gomez
`Deno.ConnectTlsOptions.{certChain,certFile,privateKey}` and `Deno.ListenTlsOptions.certChain,certFile,keyFile}` (#25525) Towards #22079
2024-09-10BREAKING(temporal/unstable): Remove obsoleted Temporal APIs part 2 (#25505)Kenta Moriuchi
Mainly I removed `Temporal.Calendar` and `Temporal.TimeZone` and replaced them to APIs that handle calendar and timezone as strings. https://github.com/tc39/proposal-temporal/pull/2925 Related #24836
2024-09-11BREAKING(fs): remove `Deno.FsFile.prototype.rid` (#25499)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-10feat: require(esm) (#25501)snek
implement require(esm) using `op_import_sync` from deno_core. possible future changes: - cts and mts - replace Deno.core.evalContext to optimize esm syntax detection Fixes: https://github.com/denoland/deno/issues/25487
2024-09-10feat(cli): use NotCapable error for permission errors (#25431)Luca Casonato
Closes #7394 --------- Co-authored-by: snek <snek@deno.com>
2024-09-10refactor: move WebGPU, FFI and FS typings from unstable to stable (#25488)Leo Kettmeir
Closes #25377
2024-09-10fix: update malva in deno to support astro css comments (#25553)HasanAlrimawi
This PR addresses issue #25534 **Code Changes** - Updated malva version to the latest in cli/Cargo.toml. - Updated LanguageOptions to match new Malva config. - Added test case same as the issue to assure changes success.
2024-09-09BREAKING: Remove `--unstable` flag (#25522)Bartek Iwańczuk
This commit effectively removes the --unstable flag. It's still being parsed, but it only prints a warning that a granular flag should be used instead and doesn't actually enable any unstable feature. Closes https://github.com/denoland/deno/issues/25485 Closes https://github.com/denoland/deno/issues/23237