diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-03-27 17:51:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-27 18:51:52 +0100 |
commit | 0e4d1cb5f9a3645f6da480b2b8540568fa69d675 (patch) | |
tree | 8d2a029a40d86f93110a825ab5d05c9bd28135da /tests | |
parent | 624e3a04e7eb92d5ce3536cec653d7aae92df5b5 (diff) |
feat(init): use jsr specifier for @std/assert (#23073)
This commit changes "deno init" subcommand to use "jsr:" specifier for
standard library "assert" module. It is unversioned, but we will change
it to `@^1` once `@std/assert` release version 1.0.
This allows us to start decoupling `deno` and `deno_std` release. The
release scripts have been updated to take that into account.
Diffstat (limited to 'tests')
5 files changed, 46 insertions, 3 deletions
diff --git a/tests/integration/init_tests.rs b/tests/integration/init_tests.rs index d3908eae4..d2a9fa59b 100644 --- a/tests/integration/init_tests.rs +++ b/tests/integration/init_tests.rs @@ -6,7 +6,7 @@ use util::TestContextBuilder; #[test] fn init_subcommand_without_dir() { - let context = TestContextBuilder::new().use_temp_cwd().build(); + let context = TestContextBuilder::for_jsr().use_temp_cwd().build(); let cwd = context.temp_dir().path(); let output = context.new_command().args("init").split_output().run(); @@ -46,7 +46,7 @@ fn init_subcommand_without_dir() { #[test] fn init_subcommand_with_dir_arg() { - let context = TestContextBuilder::new().use_temp_cwd().build(); + let context = TestContextBuilder::for_jsr().use_temp_cwd().build(); let cwd = context.temp_dir().path(); let output = context @@ -92,7 +92,7 @@ fn init_subcommand_with_dir_arg() { #[test] fn init_subcommand_with_quiet_arg() { - let context = TestContextBuilder::new().use_temp_cwd().build(); + let context = TestContextBuilder::for_jsr().use_temp_cwd().build(); let cwd = context.temp_dir().path(); let output = context diff --git a/tests/testdata/jsr/registry/@std/assert/0.220.1/assert_equals.ts b/tests/testdata/jsr/registry/@std/assert/0.220.1/assert_equals.ts new file mode 100644 index 000000000..bd58194d0 --- /dev/null +++ b/tests/testdata/jsr/registry/@std/assert/0.220.1/assert_equals.ts @@ -0,0 +1,9 @@ +// deno-lint-ignore-file +export function assertEquals<T>( + actual: T, + expected: T, + msg?: string, + options: { formatter?: (value: unknown) => string } = {}, +) { + return true; +} diff --git a/tests/testdata/jsr/registry/@std/assert/0.220.1/mod.ts b/tests/testdata/jsr/registry/@std/assert/0.220.1/mod.ts new file mode 100644 index 000000000..2d7913a02 --- /dev/null +++ b/tests/testdata/jsr/registry/@std/assert/0.220.1/mod.ts @@ -0,0 +1,20 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +/** A library of assertion functions. + * If the assertion is false an `AssertionError` will be thrown which will + * result in pretty-printed diff of failing assertion. + * + * This module is browser compatible, but do not rely on good formatting of + * values for AssertionError messages in browsers. + * + * ```ts + * import { assert } from "@std/assert/assert"; + * + * assert("I am truthy"); // Doesn't throw + * assert(false); // Throws `AssertionError` + * ``` + * + * @module + */ + +export * from "./assert_equals.ts"; diff --git a/tests/testdata/jsr/registry/@std/assert/0.220.1_meta.json b/tests/testdata/jsr/registry/@std/assert/0.220.1_meta.json new file mode 100644 index 000000000..677928167 --- /dev/null +++ b/tests/testdata/jsr/registry/@std/assert/0.220.1_meta.json @@ -0,0 +1,6 @@ +{ + "exports": { + ".": "./mod.ts", + "./assert_equals": "./assert_equals.ts" + } +} diff --git a/tests/testdata/jsr/registry/@std/assert/meta.json b/tests/testdata/jsr/registry/@std/assert/meta.json new file mode 100644 index 000000000..4bb721c89 --- /dev/null +++ b/tests/testdata/jsr/registry/@std/assert/meta.json @@ -0,0 +1,8 @@ +{ + "scope": "std", + "name": "assert", + "latest": "0.220.1", + "versions": { + "0.220.1": {} + } +} |