From 0e4d1cb5f9a3645f6da480b2b8540568fa69d675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 27 Mar 2024 17:51:52 +0000 Subject: 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. --- tests/integration/init_tests.rs | 6 +++--- .../registry/@std/assert/0.220.1/assert_equals.ts | 9 +++++++++ .../testdata/jsr/registry/@std/assert/0.220.1/mod.ts | 20 ++++++++++++++++++++ .../jsr/registry/@std/assert/0.220.1_meta.json | 6 ++++++ tests/testdata/jsr/registry/@std/assert/meta.json | 8 ++++++++ 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 tests/testdata/jsr/registry/@std/assert/0.220.1/assert_equals.ts create mode 100644 tests/testdata/jsr/registry/@std/assert/0.220.1/mod.ts create mode 100644 tests/testdata/jsr/registry/@std/assert/0.220.1_meta.json create mode 100644 tests/testdata/jsr/registry/@std/assert/meta.json (limited to 'tests') 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( + 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": {} + } +} -- cgit v1.2.3