1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

chore: update to std@2024.07.19 (#24715)

This commit is contained in:
Asher Gomez 2024-07-25 15:30:28 +10:00 committed by GitHub
parent 84b7504d0f
commit 5f44148e83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
137 changed files with 1069 additions and 322 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { parse } from "@std/flags/mod.ts"; import { parseArgs } from "@std/cli/parse-args";
const { port } = parse(Deno.args, { const { port } = parseArgs(Deno.args, {
number: ["port"], number: ["port"],
default: { default: {
port: 6969, port: 6969,

View file

@ -1,5 +1,397 @@
{ {
"imports": { "imports": {
"@std/": "./tests/util/std/" "@std/archive": "./tests/util/std/archive/mod.ts",
"@std/archive/tar": "./tests/util/std/archive/tar.ts",
"@std/archive/untar": "./tests/util/std/archive/untar.ts",
"@std/assert": "./tests/util/std/assert/mod.ts",
"@std/assert/assert": "./tests/util/std/assert/assert.ts",
"@std/assert/almost-equals": "./tests/util/std/assert/almost_equals.ts",
"@std/assert/array-includes": "./tests/util/std/assert/array_includes.ts",
"@std/assert/equals": "./tests/util/std/assert/equals.ts",
"@std/assert/exists": "./tests/util/std/assert/exists.ts",
"@std/assert/false": "./tests/util/std/assert/false.ts",
"@std/assert/greater": "./tests/util/std/assert/greater.ts",
"@std/assert/greater-or-equal": "./tests/util/std/assert/greater_or_equal.ts",
"@std/assert/instance-of": "./tests/util/std/assert/instance_of.ts",
"@std/assert/is-error": "./tests/util/std/assert/is_error.ts",
"@std/assert/less": "./tests/util/std/assert/less.ts",
"@std/assert/less-or-equal": "./tests/util/std/assert/less_or_equal.ts",
"@std/assert/match": "./tests/util/std/assert/match.ts",
"@std/assert/not-equals": "./tests/util/std/assert/not_equals.ts",
"@std/assert/not-instance-of": "./tests/util/std/assert/not_instance_of.ts",
"@std/assert/not-match": "./tests/util/std/assert/not_match.ts",
"@std/assert/not-strict-equals": "./tests/util/std/assert/not_strict_equals.ts",
"@std/assert/object-match": "./tests/util/std/assert/object_match.ts",
"@std/assert/rejects": "./tests/util/std/assert/rejects.ts",
"@std/assert/strict-equals": "./tests/util/std/assert/strict_equals.ts",
"@std/assert/string-includes": "./tests/util/std/assert/string_includes.ts",
"@std/assert/throws": "./tests/util/std/assert/throws.ts",
"@std/assert/assertion-error": "./tests/util/std/assert/assertion_error.ts",
"@std/assert/equal": "./tests/util/std/assert/equal.ts",
"@std/assert/fail": "./tests/util/std/assert/fail.ts",
"@std/assert/unimplemented": "./tests/util/std/assert/unimplemented.ts",
"@std/assert/unreachable": "./tests/util/std/assert/unreachable.ts",
"@std/async": "./tests/util/std/async/mod.ts",
"@std/async/abortable": "./tests/util/std/async/abortable.ts",
"@std/async/deadline": "./tests/util/std/async/deadline.ts",
"@std/async/debounce": "./tests/util/std/async/debounce.ts",
"@std/async/delay": "./tests/util/std/async/delay.ts",
"@std/async/mux-async-iterator": "./tests/util/std/async/mux_async_iterator.ts",
"@std/async/pool": "./tests/util/std/async/pool.ts",
"@std/async/retry": "./tests/util/std/async/retry.ts",
"@std/async/tee": "./tests/util/std/async/tee.ts",
"@std/bytes": "./tests/util/std/bytes/mod.ts",
"@std/bytes/concat": "./tests/util/std/bytes/concat.ts",
"@std/bytes/copy": "./tests/util/std/bytes/copy.ts",
"@std/bytes/ends-with": "./tests/util/std/bytes/ends_with.ts",
"@std/bytes/equals": "./tests/util/std/bytes/equals.ts",
"@std/bytes/includes-needle": "./tests/util/std/bytes/includes_needle.ts",
"@std/bytes/index-of-needle": "./tests/util/std/bytes/index_of_needle.ts",
"@std/bytes/last-index-of-needle": "./tests/util/std/bytes/last_index_of_needle.ts",
"@std/bytes/repeat": "./tests/util/std/bytes/repeat.ts",
"@std/bytes/starts-with": "./tests/util/std/bytes/starts_with.ts",
"@std/cli": "./tests/util/std/cli/mod.ts",
"@std/cli/parse-args": "./tests/util/std/cli/parse_args.ts",
"@std/cli/prompt-secret": "./tests/util/std/cli/prompt_secret.ts",
"@std/cli/spinner": "./tests/util/std/cli/spinner.ts",
"@std/cli/unicode-width": "./tests/util/std/cli/unicode_width.ts",
"@std/collections": "./tests/util/std/collections/mod.ts",
"@std/collections/aggregate-groups": "./tests/util/std/collections/aggregate_groups.ts",
"@std/collections/associate-by": "./tests/util/std/collections/associate_by.ts",
"@std/collections/associate-with": "./tests/util/std/collections/associate_with.ts",
"@std/collections/chunk": "./tests/util/std/collections/chunk.ts",
"@std/collections/deep-merge": "./tests/util/std/collections/deep_merge.ts",
"@std/collections/distinct": "./tests/util/std/collections/distinct.ts",
"@std/collections/distinct-by": "./tests/util/std/collections/distinct_by.ts",
"@std/collections/drop-last-while": "./tests/util/std/collections/drop_last_while.ts",
"@std/collections/drop-while": "./tests/util/std/collections/drop_while.ts",
"@std/collections/filter-entries": "./tests/util/std/collections/filter_entries.ts",
"@std/collections/filter-keys": "./tests/util/std/collections/filter_keys.ts",
"@std/collections/filter-values": "./tests/util/std/collections/filter_values.ts",
"@std/collections/find-single": "./tests/util/std/collections/find_single.ts",
"@std/collections/first-not-nullish-of": "./tests/util/std/collections/first_not_nullish_of.ts",
"@std/collections/includes-value": "./tests/util/std/collections/includes_value.ts",
"@std/collections/intersect": "./tests/util/std/collections/intersect.ts",
"@std/collections/invert-by": "./tests/util/std/collections/invert_by.ts",
"@std/collections/invert": "./tests/util/std/collections/invert.ts",
"@std/collections/join-to-string": "./tests/util/std/collections/join_to_string.ts",
"@std/collections/map-entries": "./tests/util/std/collections/map_entries.ts",
"@std/collections/map-keys": "./tests/util/std/collections/map_keys.ts",
"@std/collections/map-not-nullish": "./tests/util/std/collections/map_not_nullish.ts",
"@std/collections/map-values": "./tests/util/std/collections/map_values.ts",
"@std/collections/max-by": "./tests/util/std/collections/max_by.ts",
"@std/collections/max-of": "./tests/util/std/collections/max_of.ts",
"@std/collections/max-with": "./tests/util/std/collections/max_with.ts",
"@std/collections/min-by": "./tests/util/std/collections/min_by.ts",
"@std/collections/min-of": "./tests/util/std/collections/min_of.ts",
"@std/collections/min-with": "./tests/util/std/collections/min_with.ts",
"@std/collections/omit": "./tests/util/std/collections/omit.ts",
"@std/collections/partition": "./tests/util/std/collections/partition.ts",
"@std/collections/partition-entries": "./tests/util/std/collections/partition_entries.ts",
"@std/collections/permutations": "./tests/util/std/collections/permutations.ts",
"@std/collections/pick": "./tests/util/std/collections/pick.ts",
"@std/collections/reduce-groups": "./tests/util/std/collections/reduce_groups.ts",
"@std/collections/running-reduce": "./tests/util/std/collections/running_reduce.ts",
"@std/collections/sample": "./tests/util/std/collections/sample.ts",
"@std/collections/sliding-windows": "./tests/util/std/collections/sliding_windows.ts",
"@std/collections/sort-by": "./tests/util/std/collections/sort_by.ts",
"@std/collections/sum-of": "./tests/util/std/collections/sum_of.ts",
"@std/collections/take-last-while": "./tests/util/std/collections/take_last_while.ts",
"@std/collections/take-while": "./tests/util/std/collections/take_while.ts",
"@std/collections/union": "./tests/util/std/collections/union.ts",
"@std/collections/unzip": "./tests/util/std/collections/unzip.ts",
"@std/collections/without-all": "./tests/util/std/collections/without_all.ts",
"@std/collections/zip": "./tests/util/std/collections/zip.ts",
"@std/crypto": "./tests/util/std/crypto/mod.ts",
"@std/crypto/crypto": "./tests/util/std/crypto/crypto.ts",
"@std/crypto/timing-safe-equal": "./tests/util/std/crypto/timing_safe_equal.ts",
"@std/csv": "./tests/util/std/csv/mod.ts",
"@std/csv/parse": "./tests/util/std/csv/parse.ts",
"@std/csv/parse-stream": "./tests/util/std/csv/parse_stream.ts",
"@std/csv/stringify": "./tests/util/std/csv/stringify.ts",
"@std/csv/stringify-stream": "./tests/util/std/csv/stringify_stream.ts",
"@std/data-structures": "./tests/util/std/data_structures/mod.ts",
"@std/data-structures/binary-heap": "./tests/util/std/data_structures/binary_heap.ts",
"@std/data-structures/binary-search-tree": "./tests/util/std/data_structures/binary_search_tree.ts",
"@std/data-structures/comparators": "./tests/util/std/data_structures/comparators.ts",
"@std/data-structures/red-black-tree": "./tests/util/std/data_structures/red_black_tree.ts",
"@std/datetime": "./tests/util/std/datetime/mod.ts",
"@std/datetime/constants": "./tests/util/std/datetime/constants.ts",
"@std/datetime/day-of-year": "./tests/util/std/datetime/day_of_year.ts",
"@std/datetime/difference": "./tests/util/std/datetime/difference.ts",
"@std/datetime/format": "./tests/util/std/datetime/format.ts",
"@std/datetime/is-leap": "./tests/util/std/datetime/is_leap.ts",
"@std/datetime/parse": "./tests/util/std/datetime/parse.ts",
"@std/datetime/week-of-year": "./tests/util/std/datetime/week_of_year.ts",
"@std/dotenv": "./tests/util/std/dotenv/mod.ts",
"@std/dotenv/load": "./tests/util/std/dotenv/load.ts",
"@std/dotenv/parse": "./tests/util/std/dotenv/parse.ts",
"@std/dotenv/stringify": "./tests/util/std/dotenv/stringify.ts",
"@std/encoding": "./tests/util/std/encoding/mod.ts",
"@std/encoding/ascii85": "./tests/util/std/encoding/ascii85.ts",
"@std/encoding/base32": "./tests/util/std/encoding/base32.ts",
"@std/encoding/base58": "./tests/util/std/encoding/base58.ts",
"@std/encoding/base64": "./tests/util/std/encoding/base64.ts",
"@std/encoding/base64url": "./tests/util/std/encoding/base64url.ts",
"@std/encoding/hex": "./tests/util/std/encoding/hex.ts",
"@std/encoding/varint": "./tests/util/std/encoding/varint.ts",
"@std/expect": "./tests/util/std/expect/mod.ts",
"@std/expect/expect": "./tests/util/std/expect/expect.ts",
"@std/expect/fn": "./tests/util/std/expect/fn.ts",
"@std/fmt/bytes": "./tests/util/std/fmt/bytes.ts",
"@std/fmt/colors": "./tests/util/std/fmt/colors.ts",
"@std/fmt/duration": "./tests/util/std/fmt/duration.ts",
"@std/fmt/printf": "./tests/util/std/fmt/printf.ts",
"@std/front-matter": "./tests/util/std/front_matter/mod.ts",
"@std/front-matter/any": "./tests/util/std/front_matter/any.ts",
"@std/front-matter/json": "./tests/util/std/front_matter/json.ts",
"@std/front-matter/test": "./tests/util/std/front_matter/test.ts",
"@std/front-matter/toml": "./tests/util/std/front_matter/toml.ts",
"@std/front-matter/yaml": "./tests/util/std/front_matter/yaml.ts",
"@std/front-matter/types": "./tests/util/std/front_matter/types.ts",
"@std/fs": "./tests/util/std/fs/mod.ts",
"@std/fs/copy": "./tests/util/std/fs/copy.ts",
"@std/fs/empty-dir": "./tests/util/std/fs/empty_dir.ts",
"@std/fs/ensure-dir": "./tests/util/std/fs/ensure_dir.ts",
"@std/fs/ensure-file": "./tests/util/std/fs/ensure_file.ts",
"@std/fs/ensure-link": "./tests/util/std/fs/ensure_link.ts",
"@std/fs/ensure-symlink": "./tests/util/std/fs/ensure_symlink.ts",
"@std/fs/eol": "./tests/util/std/fs/eol.ts",
"@std/fs/exists": "./tests/util/std/fs/exists.ts",
"@std/fs/expand-glob": "./tests/util/std/fs/expand_glob.ts",
"@std/fs/move": "./tests/util/std/fs/move.ts",
"@std/fs/walk": "./tests/util/std/fs/walk.ts",
"@std/html": "./tests/util/std/html/mod.ts",
"@std/html/entities": "./tests/util/std/html/entities.ts",
"@std/html/named-entity-list.json": "./tests/util/std/html/named_entity_list.json",
"@std/http": "./tests/util/std/http/mod.ts",
"@std/http/cookie": "./tests/util/std/http/cookie.ts",
"@std/http/etag": "./tests/util/std/http/etag.ts",
"@std/http/file-server": "./tests/util/std/http/file_server.ts",
"@std/http/negotiation": "./tests/util/std/http/negotiation.ts",
"@std/http/server-sent-event-stream": "./tests/util/std/http/server_sent_event_stream.ts",
"@std/http/status": "./tests/util/std/http/status.ts",
"@std/http/signed-cookie": "./tests/util/std/http/signed_cookie.ts",
"@std/http/user-agent": "./tests/util/std/http/user_agent.ts",
"@std/ini": "./tests/util/std/ini/mod.ts",
"@std/ini/parse": "./tests/util/std/ini/parse.ts",
"@std/ini/stringify": "./tests/util/std/ini/stringify.ts",
"@std/internal": "./tests/util/std/internal/mod.ts",
"@std/internal/build-message": "./tests/util/std/internal/build_message.ts",
"@std/internal/diff-str": "./tests/util/std/internal/diff_str.ts",
"@std/internal/diff": "./tests/util/std/internal/diff.ts",
"@std/internal/format": "./tests/util/std/internal/format.ts",
"@std/internal/styles": "./tests/util/std/internal/styles.ts",
"@std/internal/types": "./tests/util/std/internal/types.ts",
"@std/io": "./tests/util/std/io/mod.ts",
"@std/io/buf-reader": "./tests/util/std/io/buf_reader.ts",
"@std/io/buf-writer": "./tests/util/std/io/buf_writer.ts",
"@std/io/buffer": "./tests/util/std/io/buffer.ts",
"@std/io/copy": "./tests/util/std/io/copy.ts",
"@std/io/copy-n": "./tests/util/std/io/copy_n.ts",
"@std/io/iterate-reader": "./tests/util/std/io/iterate_reader.ts",
"@std/io/limited-reader": "./tests/util/std/io/limited_reader.ts",
"@std/io/multi-reader": "./tests/util/std/io/multi_reader.ts",
"@std/io/read-all": "./tests/util/std/io/read_all.ts",
"@std/io/read-delim": "./tests/util/std/io/read_delim.ts",
"@std/io/read-int": "./tests/util/std/io/read_int.ts",
"@std/io/read-lines": "./tests/util/std/io/read_lines.ts",
"@std/io/read-long": "./tests/util/std/io/read_long.ts",
"@std/io/read-range": "./tests/util/std/io/read_range.ts",
"@std/io/read-short": "./tests/util/std/io/read_short.ts",
"@std/io/read-string-delim": "./tests/util/std/io/read_string_delim.ts",
"@std/io/reader-from-stream-reader": "./tests/util/std/io/reader_from_stream_reader.ts",
"@std/io/slice-long-to-bytes": "./tests/util/std/io/slice_long_to_bytes.ts",
"@std/io/string-reader": "./tests/util/std/io/string_reader.ts",
"@std/io/string-writer": "./tests/util/std/io/string_writer.ts",
"@std/io/to-readable-stream": "./tests/util/std/io/to_readable_stream.ts",
"@std/io/to-writable-stream": "./tests/util/std/io/to_writable_stream.ts",
"@std/io/types": "./tests/util/std/io/types.ts",
"@std/io/write-all": "./tests/util/std/io/write_all.ts",
"@std/json": "./tests/util/std/json/mod.ts",
"@std/json/types": "./tests/util/std/json/types.ts",
"@std/json/concatenated-json-parse-stream": "./tests/util/std/json/concatenated_json_parse_stream.ts",
"@std/json/parse-stream": "./tests/util/std/json/parse_stream.ts",
"@std/json/stringify-stream": "./tests/util/std/json/stringify_stream.ts",
"@std/jsonc": "./tests/util/std/jsonc/mod.ts",
"@std/jsonc/parse": "./tests/util/std/jsonc/parse.ts",
"@std/log": "./tests/util/std/log/mod.ts",
"@std/log/base-handler": "./tests/util/std/log/base_handler.ts",
"@std/log/console-handler": "./tests/util/std/log/console_handler.ts",
"@std/log/critical": "./tests/util/std/log/critical.ts",
"@std/log/debug": "./tests/util/std/log/debug.ts",
"@std/log/error": "./tests/util/std/log/error.ts",
"@std/log/file-handler": "./tests/util/std/log/file_handler.ts",
"@std/log/formatters": "./tests/util/std/log/formatters.ts",
"@std/log/get-logger": "./tests/util/std/log/get_logger.ts",
"@std/log/info": "./tests/util/std/log/info.ts",
"@std/log/levels": "./tests/util/std/log/levels.ts",
"@std/log/logger": "./tests/util/std/log/logger.ts",
"@std/log/rotating-file-handler": "./tests/util/std/log/rotating_file_handler.ts",
"@std/log/setup": "./tests/util/std/log/setup.ts",
"@std/log/warn": "./tests/util/std/log/warn.ts",
"@std/media-types": "./tests/util/std/media_types/mod.ts",
"@std/media-types/content-type": "./tests/util/std/media_types/content_type.ts",
"@std/media-types/extension": "./tests/util/std/media_types/extension.ts",
"@std/media-types/all-extensions": "./tests/util/std/media_types/all_extensions.ts",
"@std/media-types/format-media-type": "./tests/util/std/media_types/format_media_type.ts",
"@std/media-types/get-charset": "./tests/util/std/media_types/get_charset.ts",
"@std/media-types/parse-media-type": "./tests/util/std/media_types/parse_media_type.ts",
"@std/media-types/type-by-extension": "./tests/util/std/media_types/type_by_extension.ts",
"@std/msgpack": "./tests/util/std/msgpack/mod.ts",
"@std/msgpack/decode": "./tests/util/std/msgpack/decode.ts",
"@std/msgpack/encode": "./tests/util/std/msgpack/encode.ts",
"@std/net": "./tests/util/std/net/mod.ts",
"@std/net/get-available-port": "./tests/util/std/net/get_available_port.ts",
"@std/net/get-network-address": "./tests/util/std/net/get_network_address.ts",
"@std/path": "./tests/util/std/path/mod.ts",
"@std/path/basename": "./tests/util/std/path/basename.ts",
"@std/path/common": "./tests/util/std/path/common.ts",
"@std/path/constants": "./tests/util/std/path/constants.ts",
"@std/path/dirname": "./tests/util/std/path/dirname.ts",
"@std/path/extname": "./tests/util/std/path/extname.ts",
"@std/path/format": "./tests/util/std/path/format.ts",
"@std/path/from-file-url": "./tests/util/std/path/from_file_url.ts",
"@std/path/glob-to-regexp": "./tests/util/std/path/glob_to_regexp.ts",
"@std/path/is-absolute": "./tests/util/std/path/is_absolute.ts",
"@std/path/is-glob": "./tests/util/std/path/is_glob.ts",
"@std/path/join": "./tests/util/std/path/join.ts",
"@std/path/join-globs": "./tests/util/std/path/join_globs.ts",
"@std/path/normalize": "./tests/util/std/path/normalize.ts",
"@std/path/normalize-glob": "./tests/util/std/path/normalize_glob.ts",
"@std/path/parse": "./tests/util/std/path/parse.ts",
"@std/path/posix": "./tests/util/std/path/posix/mod.ts",
"@std/path/posix/basename": "./tests/util/std/path/posix/basename.ts",
"@std/path/posix/common": "./tests/util/std/path/posix/common.ts",
"@std/path/posix/constants": "./tests/util/std/path/posix/constants.ts",
"@std/path/posix/dirname": "./tests/util/std/path/posix/dirname.ts",
"@std/path/posix/extname": "./tests/util/std/path/posix/extname.ts",
"@std/path/posix/format": "./tests/util/std/path/posix/format.ts",
"@std/path/posix/from-file-url": "./tests/util/std/path/posix/from_file_url.ts",
"@std/path/posix/glob-to-regexp": "./tests/util/std/path/posix/glob_to_regexp.ts",
"@std/path/posix/is-absolute": "./tests/util/std/path/posix/is_absolute.ts",
"@std/path/posix/is-glob": "./tests/util/std/path/posix/is_glob.ts",
"@std/path/posix/join": "./tests/util/std/path/posix/join.ts",
"@std/path/posix/join-globs": "./tests/util/std/path/posix/join_globs.ts",
"@std/path/posix/normalize": "./tests/util/std/path/posix/normalize.ts",
"@std/path/posix/normalize-glob": "./tests/util/std/path/posix/normalize_glob.ts",
"@std/path/posix/parse": "./tests/util/std/path/posix/parse.ts",
"@std/path/posix/relative": "./tests/util/std/path/posix/relative.ts",
"@std/path/posix/resolve": "./tests/util/std/path/posix/resolve.ts",
"@std/path/posix/to-file-url": "./tests/util/std/path/posix/to_file_url.ts",
"@std/path/posix/to-namespaced-path": "./tests/util/std/path/posix/to_namespaced_path.ts",
"@std/path/relative": "./tests/util/std/path/relative.ts",
"@std/path/resolve": "./tests/util/std/path/resolve.ts",
"@std/path/to-file-url": "./tests/util/std/path/to_file_url.ts",
"@std/path/to-namespaced-path": "./tests/util/std/path/to_namespaced_path.ts",
"@std/path/types": "./tests/util/std/path/types.ts",
"@std/path/windows": "./tests/util/std/path/windows/mod.ts",
"@std/path/windows/basename": "./tests/util/std/path/windows/basename.ts",
"@std/path/windows/common": "./tests/util/std/path/windows/common.ts",
"@std/path/windows/constants": "./tests/util/std/path/windows/constants.ts",
"@std/path/windows/dirname": "./tests/util/std/path/windows/dirname.ts",
"@std/path/windows/extname": "./tests/util/std/path/windows/extname.ts",
"@std/path/windows/format": "./tests/util/std/path/windows/format.ts",
"@std/path/windows/from-file-url": "./tests/util/std/path/windows/from_file_url.ts",
"@std/path/windows/glob-to-regexp": "./tests/util/std/path/windows/glob_to_regexp.ts",
"@std/path/windows/is-absolute": "./tests/util/std/path/windows/is_absolute.ts",
"@std/path/windows/is-glob": "./tests/util/std/path/windows/is_glob.ts",
"@std/path/windows/join": "./tests/util/std/path/windows/join.ts",
"@std/path/windows/join-globs": "./tests/util/std/path/windows/join_globs.ts",
"@std/path/windows/normalize": "./tests/util/std/path/windows/normalize.ts",
"@std/path/windows/normalize-glob": "./tests/util/std/path/windows/normalize_glob.ts",
"@std/path/windows/parse": "./tests/util/std/path/windows/parse.ts",
"@std/path/windows/relative": "./tests/util/std/path/windows/relative.ts",
"@std/path/windows/resolve": "./tests/util/std/path/windows/resolve.ts",
"@std/path/windows/to-file-url": "./tests/util/std/path/windows/to_file_url.ts",
"@std/path/windows/to-namespaced-path": "./tests/util/std/path/windows/to_namespaced_path.ts",
"@std/regexp": "./tests/util/std/regexp/mod.ts",
"@std/regexp/escape": "./tests/util/std/regexp/escape.ts",
"@std/semver": "./tests/util/std/semver/mod.ts",
"@std/semver/can-parse": "./tests/util/std/semver/can_parse.ts",
"@std/semver/compare": "./tests/util/std/semver/compare.ts",
"@std/semver/difference": "./tests/util/std/semver/difference.ts",
"@std/semver/equals": "./tests/util/std/semver/equals.ts",
"@std/semver/format": "./tests/util/std/semver/format.ts",
"@std/semver/format-range": "./tests/util/std/semver/format_range.ts",
"@std/semver/greater-or-equal": "./tests/util/std/semver/greater_or_equal.ts",
"@std/semver/greater-than": "./tests/util/std/semver/greater_than.ts",
"@std/semver/greater-than-range": "./tests/util/std/semver/greater_than_range.ts",
"@std/semver/increment": "./tests/util/std/semver/increment.ts",
"@std/semver/is-range": "./tests/util/std/semver/is_range.ts",
"@std/semver/is-semver": "./tests/util/std/semver/is_semver.ts",
"@std/semver/less-or-equal": "./tests/util/std/semver/less_or_equal.ts",
"@std/semver/less-than": "./tests/util/std/semver/less_than.ts",
"@std/semver/less-than-range": "./tests/util/std/semver/less_than_range.ts",
"@std/semver/max-satisfying": "./tests/util/std/semver/max_satisfying.ts",
"@std/semver/min-satisfying": "./tests/util/std/semver/min_satisfying.ts",
"@std/semver/not-equals": "./tests/util/std/semver/not_equals.ts",
"@std/semver/parse": "./tests/util/std/semver/parse.ts",
"@std/semver/parse-range": "./tests/util/std/semver/parse_range.ts",
"@std/semver/range-intersects": "./tests/util/std/semver/range_intersects.ts",
"@std/semver/satisfies": "./tests/util/std/semver/satisfies.ts",
"@std/semver/try-parse": "./tests/util/std/semver/try_parse.ts",
"@std/semver/try-parse-range": "./tests/util/std/semver/try_parse_range.ts",
"@std/semver/types": "./tests/util/std/semver/types.ts",
"@std/streams": "./tests/util/std/streams/mod.ts",
"@std/streams/buffer": "./tests/util/std/streams/buffer.ts",
"@std/streams/byte-slice-stream": "./tests/util/std/streams/byte_slice_stream.ts",
"@std/streams/concat-readable-streams": "./tests/util/std/streams/concat_readable_streams.ts",
"@std/streams/delimiter-stream": "./tests/util/std/streams/delimiter_stream.ts",
"@std/streams/early-zip-readable-streams": "./tests/util/std/streams/early_zip_readable_streams.ts",
"@std/streams/limited-bytes-transform-stream": "./tests/util/std/streams/limited_bytes_transform_stream.ts",
"@std/streams/limited-transform-stream": "./tests/util/std/streams/limited_transform_stream.ts",
"@std/streams/merge-readable-streams": "./tests/util/std/streams/merge_readable_streams.ts",
"@std/streams/text-delimiter-stream": "./tests/util/std/streams/text_delimiter_stream.ts",
"@std/streams/text-line-stream": "./tests/util/std/streams/text_line_stream.ts",
"@std/streams/to-array-buffer": "./tests/util/std/streams/to_array_buffer.ts",
"@std/streams/to-blob": "./tests/util/std/streams/to_blob.ts",
"@std/streams/to-json": "./tests/util/std/streams/to_json.ts",
"@std/streams/to-text": "./tests/util/std/streams/to_text.ts",
"@std/streams/to-transform-stream": "./tests/util/std/streams/to_transform_stream.ts",
"@std/streams/zip-readable-streams": "./tests/util/std/streams/zip_readable_streams.ts",
"@std/testing/bdd": "./tests/util/std/testing/bdd.ts",
"@std/testing/mock": "./tests/util/std/testing/mock.ts",
"@std/testing/snapshot": "./tests/util/std/testing/snapshot.ts",
"@std/testing/time": "./tests/util/std/testing/time.ts",
"@std/testing/types": "./tests/util/std/testing/types.ts",
"@std/text": "./tests/util/std/text/mod.ts",
"@std/text/closest-string": "./tests/util/std/text/closest_string.ts",
"@std/text/compare-similarity": "./tests/util/std/text/compare_similarity.ts",
"@std/text/levenshtein-distance": "./tests/util/std/text/levenshtein_distance.ts",
"@std/text/to-camel-case": "./tests/util/std/text/to_camel_case.ts",
"@std/text/to-constant-case": "./tests/util/std/text/to_constant_case.ts",
"@std/text/to-kebab-case": "./tests/util/std/text/to_kebab_case.ts",
"@std/text/to-pascal-case": "./tests/util/std/text/to_pascal_case.ts",
"@std/text/to-snake-case": "./tests/util/std/text/to_snake_case.ts",
"@std/text/word-similarity-sort": "./tests/util/std/text/word_similarity_sort.ts",
"@std/toml": "./tests/util/std/toml/mod.ts",
"@std/toml/parse": "./tests/util/std/toml/parse.ts",
"@std/toml/stringify": "./tests/util/std/toml/stringify.ts",
"@std/ulid": "./tests/util/std/ulid/mod.ts",
"@std/ulid/decode-time": "./tests/util/std/ulid/decode_time.ts",
"@std/ulid/monotonic-ulid": "./tests/util/std/ulid/monotonic_ulid.ts",
"@std/ulid/ulid": "./tests/util/std/ulid/ulid.ts",
"@std/url": "./tests/util/std/url/mod.ts",
"@std/url/basename": "./tests/util/std/url/basename.ts",
"@std/url/dirname": "./tests/util/std/url/dirname.ts",
"@std/url/extname": "./tests/util/std/url/extname.ts",
"@std/url/join": "./tests/util/std/url/join.ts",
"@std/url/normalize": "./tests/util/std/url/normalize.ts",
"@std/uuid": "./tests/util/std/uuid/mod.ts",
"@std/uuid/common": "./tests/util/std/uuid/common.ts",
"@std/uuid/constants": "./tests/util/std/uuid/constants.ts",
"@std/uuid/v1": "./tests/util/std/uuid/v1.ts",
"@std/uuid/v3": "./tests/util/std/uuid/v3.ts",
"@std/uuid/v4": "./tests/util/std/uuid/v4.ts",
"@std/uuid/v5": "./tests/util/std/uuid/v5.ts",
"@std/webgpu": "./tests/util/std/webgpu/mod.ts",
"@std/webgpu/create-capture": "./tests/util/std/webgpu/create_capture.ts",
"@std/webgpu/describe-texture-format": "./tests/util/std/webgpu/describe_texture_format.ts",
"@std/webgpu/row-padding": "./tests/util/std/webgpu/row_padding.ts",
"@std/webgpu/texture-with-data": "./tests/util/std/webgpu/texture_with_data.ts",
"@std/yaml": "./tests/util/std/yaml/mod.ts",
"@std/yaml/parse": "./tests/util/std/yaml/parse.ts",
"@std/yaml/stringify": "./tests/util/std/yaml/stringify.ts"
} }
} }

View file

@ -10,7 +10,7 @@ import {
assertInstanceOf, assertInstanceOf,
assertEquals, assertEquals,
assertFalse, assertFalse,
} from "@std/assert/mod.ts"; } from "@std/assert";
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
const [libPrefix, libSuffix] = { const [libPrefix, libSuffix] = {

View file

@ -1,12 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
export { export { assert, assertEquals, assertRejects, assertThrows } from "@std/assert";
assert, export { fromFileUrl } from "@std/path";
assertEquals,
assertRejects,
assertThrows,
} from "@std/assert/mod.ts";
export { fromFileUrl } from "@std/path/mod.ts";
import process from "node:process"; import process from "node:process";
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { partition } from "@std/collections/partition.ts"; import { partition } from "@std/collections/partition";
import { join } from "@std/path/mod.ts"; import { join } from "@std/path";
import * as JSONC from "@std/jsonc/mod.ts"; import * as JSONC from "@std/jsonc";
/** /**
* The test suite matches the folders inside the `test` folder inside the * The test suite matches the folders inside the `test` folder inside the
* node repo * node repo

View file

@ -1,6 +1,3 @@
{ {
"imports": { "importMap": "../../import_map.json"
"@test_util/": "../../test_util/",
"@std/": "../util/std/"
}
} }

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import "./polyfill_globals.js"; import "./polyfill_globals.js";
import { createRequire } from "node:module"; import { createRequire } from "node:module";
import { toFileUrl } from "@std/path/mod.ts"; import { toFileUrl } from "@std/path/to-file-url";
const file = Deno.args[0]; const file = Deno.args[0];
if (!file) { if (!file) {
throw new Error("No file provided"); throw new Error("No file provided");

View file

@ -1,8 +1,5 @@
{ {
"imports": { "importMap": "../../../import_map.json",
"@test_util/": "../../test_util/",
"@std/": "../../util/std/"
},
"tasks": { "tasks": {
"setup": "deno run --allow-read --allow-write ./setup.ts", "setup": "deno run --allow-read --allow-write ./setup.ts",
"test": "deno test -A ../test.ts --" "test": "deno test -A ../test.ts --"

View file

@ -3,12 +3,12 @@
/** This copies the test files according to the config file `tests/node_compat/config.jsonc` */ /** This copies the test files according to the config file `tests/node_compat/config.jsonc` */
import { walk } from "@std/fs/walk.ts"; import { walk } from "@std/fs/walk";
import { SEPARATOR } from "@std/path/constants.ts"; import { SEPARATOR } from "@std/path/constants";
import { ensureFile } from "@std/fs/ensure_file.ts"; import { ensureFile } from "@std/fs/ensure-file";
import { writeAll } from "@std/io/write_all.ts"; import { writeAll } from "@std/io/write-all";
import { withoutAll } from "@std/collections/without_all.ts"; import { withoutAll } from "@std/collections/without-all";
import { relative } from "@std/path/posix/relative.ts"; import { relative } from "@std/path/posix/relative";
import { config, ignoreList } from "../common.ts"; import { config, ignoreList } from "../common.ts";

View file

@ -13,10 +13,10 @@
* all share the same working directory. * all share the same working directory.
*/ */
import { magenta } from "@std/fmt/colors.ts"; import { magenta } from "@std/fmt/colors";
import { pooledMap } from "@std/async/pool.ts"; import { pooledMap } from "@std/async/pool";
import { dirname, fromFileUrl, join } from "@std/path/mod.ts"; import { dirname, fromFileUrl, join } from "@std/path";
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { import {
config, config,
getPathsFromTestSuites, getPathsFromTestSuites,

View file

@ -1,4 +1,4 @@
import { delay } from "@std/async/delay.ts"; import { delay } from "@std/async/delay";
const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" }); const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
await delay(1_000); await delay(1_000);

View file

@ -1,4 +1,4 @@
import { delay } from "@std/async/delay.ts"; import { delay } from "@std/async/delay";
const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" }); const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
await delay(1_000); await delay(1_000);

View file

@ -1,14 +1,10 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { Server } from "@std/http/server.ts";
const addr = Deno.args[1] || "localhost:4555"; const addr = Deno.args[1] || "localhost:4555";
async function proxyServer() { function proxyServer() {
const [hostname, p] = addr.split(":"); const [hostname, p] = addr.split(":");
const port = parseInt(p ?? 4555); const port = parseInt(p ?? 4555);
const server = new Server({ hostname, port, handler }); Deno.serve({ hostname, port }, handler);
console.log(`Proxy server listening on http://${addr}/`);
await server.listenAndServe();
} }
async function handler(req: Request): Promise<Response> { async function handler(req: Request): Promise<Response> {

View file

@ -1,4 +1,4 @@
Proxy server listening on [WILDCARD] Listening on [WILDCARD]
Proxy request to: http://localhost:4545/run/045_mod.ts Proxy request to: http://localhost:4545/run/045_mod.ts
Proxy request to: http://localhost:4545/run/045_mod.ts Proxy request to: http://localhost:4545/run/045_mod.ts
Proxy request to: http://localhost:4545/run/045_output.ts Proxy request to: http://localhost:4545/run/045_output.ts

View file

@ -1,4 +1,4 @@
import { emptyDir } from "@std/fs/empty_dir.ts"; import { emptyDir } from "@std/fs/empty-dir";
const DIR = "./coverage"; const DIR = "./coverage";
const COMMAND = new Deno.Command(Deno.execPath(), { const COMMAND = new Deno.Command(Deno.execPath(), {

View file

@ -1,5 +1,5 @@
import { sum } from "./sum.js"; import { sum } from "./sum.js";
import { assertEquals } from "@std/assert/assert_equals.ts"; import { assertEquals } from "@std/assert/equals";
Deno.test("sum()", () => { Deno.test("sum()", () => {
assertEquals(sum(1, 2), 3); assertEquals(sum(1, 2), 3);

View file

@ -1,4 +1,4 @@
import { assertRejects } from "@std/assert/mod.ts"; import { assertRejects } from "@std/assert";
const listener = Deno.listenTls({ const listener = Deno.listenTls({
port: Number(Deno.args[0]), port: Number(Deno.args[0]),

View file

@ -1,5 +1,2 @@
// unversioned import redirects with dependencies. // unversioned import redirects with dependencies.
import { import { assertNotEquals as _a, assertStrictEquals as _b } from "@std/assert";
assertNotEquals as _a,
assertStrictEquals as _b,
} from "@std/assert/mod.ts";

View file

@ -1,4 +1,4 @@
import { assertSnapshot } from "@std/testing/snapshot.ts"; import { assertSnapshot } from "@std/testing/snapshot";
import { truth } from "./no_snaps_included.ts"; import { truth } from "./no_snaps_included.ts";
Deno.test("the truth", () => { Deno.test("the truth", () => {

View file

@ -1,5 +1,5 @@
import { addNumbers } from "./foo.ts"; import { addNumbers } from "./foo.ts";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
Deno.test("addNumbers works", () => { Deno.test("addNumbers works", () => {
assertEquals(addNumbers(1, 2), 3); assertEquals(addNumbers(1, 2), 3);

View file

@ -1,5 +1,5 @@
import { addNumbers } from "./foo.ts"; import { addNumbers } from "./foo.ts";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
Deno.test("addNumbers works", () => { Deno.test("addNumbers works", () => {
assertEquals(addNumbers(1, 2), 3); assertEquals(addNumbers(1, 2), 3);

View file

@ -1,5 +1,5 @@
import { addNumbers } from "./foo.ts"; import { addNumbers } from "./foo.ts";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
Deno.test("addNumbers works", () => { Deno.test("addNumbers works", () => {
assertEquals(addNumbers(1, 2), 3); assertEquals(addNumbers(1, 2), 3);

View file

@ -1,3 +1,3 @@
export { assertStrictEquals } from "@std/assert/mod.ts"; export { assertStrictEquals } from "@std/assert";
export * from "./interface.ts"; export * from "./interface.ts";

View file

@ -1,4 +1,4 @@
import { copy } from "@std/io/copy.ts"; import { copy } from "@std/io/copy";
const addr = Deno.args[0] || "0.0.0.0:4544"; const addr = Deno.args[0] || "0.0.0.0:4544";
const [hostname, port] = addr.split(":"); const [hostname, port] = addr.split(":");
const listener = Deno.listen({ hostname, port: Number(port) }); const listener = Deno.listen({ hostname, port: Number(port) });

View file

@ -1,6 +1,7 @@
{ {
"imports": { "imports": {
"@std/": "../../../util/std/", "@std/assert/throws": "../../../util/std/assert/throws.ts",
"@std/internal/styles": "../../../util/std/internal/styles.ts",
"bare": "https://example.com/", "bare": "https://example.com/",
"https://example.com/rewrite": "https://example.com/rewritten", "https://example.com/rewrite": "https://example.com/rewritten",

View file

@ -1,4 +1,4 @@
import { assertThrows } from "@std/assert/mod.ts"; import { assertThrows } from "@std/assert/throws";
import "http://localhost:4545/run/import_meta/other.ts"; import "http://localhost:4545/run/import_meta/other.ts";
import "./other.ts"; import "./other.ts";

View file

@ -1,5 +1,5 @@
// deno-lint-ignore-file no-window-prefix // deno-lint-ignore-file no-window-prefix
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
import "./nest_imported.ts"; import "./nest_imported.ts";
const handler = (e: Event) => { const handler = (e: Event) => {

View file

@ -1,5 +1,5 @@
// deno-lint-ignore-file no-window-prefix no-prototype-builtins // deno-lint-ignore-file no-window-prefix no-prototype-builtins
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
import "./imported.ts"; import "./imported.ts";
assert(window.hasOwnProperty("onload")); assert(window.hasOwnProperty("onload"));

View file

@ -1,5 +1,5 @@
// deno-lint-ignore-file no-window-prefix // deno-lint-ignore-file no-window-prefix
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
const handler = (e: Event) => { const handler = (e: Event) => {
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);

View file

@ -14,8 +14,8 @@
* @module * @module
*/ */
import type { BufReader, ReadLineResult } from "@std/io/buf_reader.ts"; import type { BufReader, ReadLineResult } from "@std/io/buf-reader";
import { concat } from "@std/bytes/concat.ts"; import { concat } from "@std/bytes/concat";
// Constants created for DRY // Constants created for DRY
const CHAR_SPACE: number = " ".charCodeAt(0); const CHAR_SPACE: number = " ".charCodeAt(0);

View file

@ -1,5 +1,5 @@
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
import { BufReader, BufWriter } from "@std/io/mod.ts"; import { BufReader, BufWriter } from "@std/io";
import { TextProtoReader } from "./textproto.ts"; import { TextProtoReader } from "./textproto.ts";
const encoder = new TextEncoder(); const encoder = new TextEncoder();

View file

@ -1,6 +1,6 @@
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
import { BufReader } from "@std/io/buf_reader.ts"; import { BufReader } from "@std/io/buf-reader";
import { BufWriter } from "@std/io/buf_writer.ts"; import { BufWriter } from "@std/io/buf-writer";
import { TextProtoReader } from "./textproto.ts"; import { TextProtoReader } from "./textproto.ts";
const encoder = new TextEncoder(); const encoder = new TextEncoder();

View file

@ -1,4 +1,4 @@
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
const errorDeferred = Promise.withResolvers<void>(); const errorDeferred = Promise.withResolvers<void>();
const closeDeferred = Promise.withResolvers<void>(); const closeDeferred = Promise.withResolvers<void>();

View file

@ -1,4 +1,4 @@
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
const permissions: Deno.PermissionName[] = [ const permissions: Deno.PermissionName[] = [
"read", "read",

View file

@ -1,4 +1,4 @@
import { unreachable } from "@std/assert/mod.ts"; import { unreachable } from "@std/assert";
const permissions: Deno.PermissionName[] = [ const permissions: Deno.PermissionName[] = [
"read", "read",

View file

@ -1,4 +1,4 @@
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
onmessage = function (e) { onmessage = function (e) {
if (typeof self.Deno === "undefined") { if (typeof self.Deno === "undefined") {

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals, assertStringIncludes } from "./test_util.ts"; import { assert, assertEquals, assertStringIncludes } from "./test_util.ts";
import { concat } from "@std/bytes/concat.ts"; import { concat } from "@std/bytes/concat";
Deno.test(function blobString() { Deno.test(function blobString() {
const b1 = new Blob(["Hello World"]); const b1 = new Blob(["Hello World"]);

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
Deno.test("BroadcastChannel worker", async () => { Deno.test("BroadcastChannel worker", async () => {
const intercom = new BroadcastChannel("intercom"); const intercom = new BroadcastChannel("intercom");

View file

@ -11,7 +11,7 @@ import {
assertRejects, assertRejects,
assertThrows, assertThrows,
} from "./test_util.ts"; } from "./test_util.ts";
import { writeAllSync } from "@std/io/write_all.ts"; import { writeAllSync } from "@std/io/write-all";
const MAX_SIZE = 2 ** 32 - 2; const MAX_SIZE = 2 ** 32 - 2;
// N controls how many iterations of certain checks are performed. // N controls how many iterations of certain checks are performed.

View file

@ -14,7 +14,7 @@ import {
assertStringIncludes, assertStringIncludes,
assertThrows, assertThrows,
} from "./test_util.ts"; } from "./test_util.ts";
import { stripColor } from "@std/fmt/colors.ts"; import { stripAnsiCode } from "@std/fmt/colors";
const customInspect = Symbol.for("Deno.customInspect"); const customInspect = Symbol.for("Deno.customInspect");
const { const {
@ -27,7 +27,7 @@ const {
} = Deno[Deno.internal]; } = Deno[Deno.internal];
function stringify(...args: unknown[]): string { function stringify(...args: unknown[]): string {
return stripColor(inspectArgs(args).replace(/\n$/, "")); return stripAnsiCode(inspectArgs(args).replace(/\n$/, ""));
} }
interface Css { interface Css {
@ -372,7 +372,7 @@ Deno.test(function consoleTestStringifyCircular() {
}`, }`,
); );
// test inspect is working the same // test inspect is working the same
assertEquals(stripColor(Deno.inspect(nestedObj)), nestedObjExpected); assertEquals(stripAnsiCode(Deno.inspect(nestedObj)), nestedObjExpected);
}); });
Deno.test(function consoleTestStringifyMultipleCircular() { Deno.test(function consoleTestStringifyMultipleCircular() {
@ -451,7 +451,7 @@ Deno.test(function consoleTestStringifyFunctionWithProperties() {
); );
assertEquals( assertEquals(
stripColor(Deno.inspect(Array, { showHidden: true })), stripAnsiCode(Deno.inspect(Array, { showHidden: true })),
`<ref *1> [Function: Array] { `<ref *1> [Function: Array] {
[length]: 1, [length]: 1,
[name]: "Array", [name]: "Array",
@ -529,24 +529,24 @@ Deno.test(function consoleTestStringifyWithDepth() {
// deno-lint-ignore no-explicit-any // deno-lint-ignore no-explicit-any
const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } }; const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } };
assertEquals( assertEquals(
stripColor(inspectArgs([nestedObj], { depth: 3 })), stripAnsiCode(inspectArgs([nestedObj], { depth: 3 })),
"{\n a: { b: { c: { d: [Object] } } }\n}", "{\n a: { b: { c: { d: [Object] } } }\n}",
); );
assertEquals( assertEquals(
stripColor(inspectArgs([nestedObj], { depth: 4 })), stripAnsiCode(inspectArgs([nestedObj], { depth: 4 })),
"{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}", "{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}",
); );
assertEquals( assertEquals(
stripColor(inspectArgs([nestedObj], { depth: 0 })), stripAnsiCode(inspectArgs([nestedObj], { depth: 0 })),
"{ a: [Object] }", "{ a: [Object] }",
); );
assertEquals( assertEquals(
stripColor(inspectArgs([nestedObj])), stripAnsiCode(inspectArgs([nestedObj])),
"{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}", "{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}",
); );
// test inspect is working the same way // test inspect is working the same way
assertEquals( assertEquals(
stripColor(Deno.inspect(nestedObj, { depth: 4 })), stripAnsiCode(Deno.inspect(nestedObj, { depth: 4 })),
"{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}", "{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}",
); );
}); });
@ -1032,11 +1032,13 @@ Deno.test(function consoleTestIteratorValueAreNotConsumed() {
Deno.test(function consoleTestWeakSetAndWeakMapWithShowHidden() { Deno.test(function consoleTestWeakSetAndWeakMapWithShowHidden() {
assertEquals( assertEquals(
stripColor(Deno.inspect(new WeakSet([{}]), { showHidden: true })), stripAnsiCode(Deno.inspect(new WeakSet([{}]), { showHidden: true })),
"WeakSet { {} }", "WeakSet { {} }",
); );
assertEquals( assertEquals(
stripColor(Deno.inspect(new WeakMap([[{}, "foo"]]), { showHidden: true })), stripAnsiCode(
Deno.inspect(new WeakMap([[{}, "foo"]]), { showHidden: true }),
),
'WeakMap { {} => "foo" }', 'WeakMap { {} => "foo" }',
); );
}); });
@ -1195,7 +1197,10 @@ Deno.test(function consoleTestWithObjectFormatSpecifier() {
Deno.test(function consoleTestWithStyleSpecifier() { Deno.test(function consoleTestWithStyleSpecifier() {
assertEquals(stringify("%cfoo%cbar"), "%cfoo%cbar"); assertEquals(stringify("%cfoo%cbar"), "%cfoo%cbar");
assertEquals(stringify("%cfoo%cbar", ""), "foo%cbar"); assertEquals(stringify("%cfoo%cbar", ""), "foo%cbar");
assertEquals(stripColor(stringify("%cfoo%cbar", "", "color: red")), "foobar"); assertEquals(
stripAnsiCode(stringify("%cfoo%cbar", "", "color: red")),
"foobar",
);
}); });
Deno.test(function consoleParseCssColor() { Deno.test(function consoleParseCssColor() {
@ -1532,7 +1537,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table({ a: "test", b: 1 }); console.table({ a: "test", b: 1 });
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) Values (idx) Values
@ -1546,7 +1551,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table({ a: { b: 10 }, b: { b: 20, c: 30 } }, ["c"]); console.table({ a: { b: 10 }, b: { b: 20, c: 30 } }, ["c"]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) c (idx) c
@ -1560,7 +1565,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table([[1, 1], [234, 2.34], [56789, 56.789]]); console.table([[1, 1], [234, 2.34], [56789, 56.789]]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) 0 1 (idx) 0 1
@ -1575,7 +1580,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table([1, 2, [3, [4]], [5, 6], [[7], [8]]]); console.table([1, 2, [3, [4]], [5, 6], [[7], [8]]]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) 0 1 Values (idx) 0 1 Values
@ -1592,7 +1597,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table(new Set([1, 2, 3, "test"])); console.table(new Set([1, 2, 3, "test"]));
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(iter idx) Values (iter idx) Values
@ -1613,7 +1618,7 @@ Deno.test(function consoleTable() {
]), ]),
); );
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(iter idx) Key Values (iter idx) Key Values
@ -1633,7 +1638,7 @@ Deno.test(function consoleTable() {
h: new Map([[1, "one"]]), h: new Map([[1, "one"]]),
}); });
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) c e Values (idx) c e Values
@ -1656,7 +1661,7 @@ Deno.test(function consoleTable() {
["test", { b: 20, c: "test" }], ["test", { b: 20, c: "test" }],
]); ]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) 0 1 a Values (idx) 0 1 a Values
@ -1673,7 +1678,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table([]); console.table([]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) (idx)
@ -1685,7 +1690,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table({}); console.table({});
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) (idx)
@ -1697,7 +1702,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table(new Set()); console.table(new Set());
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(iter idx) (iter idx)
@ -1709,7 +1714,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table(new Map()); console.table(new Map());
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(iter idx) (iter idx)
@ -1725,7 +1730,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table(["Hello", "你好", "Amapá"]); console.table(["Hello", "你好", "Amapá"]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) Values (idx) Values
@ -1743,7 +1748,7 @@ Deno.test(function consoleTable() {
[3, 4], [3, 4],
]); ]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) 0 1 (idx) 0 1
@ -1757,7 +1762,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table({ 1: { a: 4, b: 5 }, 2: null, 3: { b: 6, c: 7 } }, ["b"]); console.table({ 1: { a: 4, b: 5 }, 2: null, 3: { b: 6, c: 7 } }, ["b"]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) b (idx) b
@ -1772,7 +1777,7 @@ Deno.test(function consoleTable() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.table([{ a: 0 }, { a: 1, b: 1 }, { a: 2 }, { a: 3, b: 3 }]); console.table([{ a: 0 }, { a: 1, b: 1 }, { a: 2 }, { a: 3, b: 3 }]);
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) a b (idx) a b
@ -1791,7 +1796,7 @@ Deno.test(function consoleTable() {
["a", "b", "c"], ["a", "b", "c"],
); );
assertEquals( assertEquals(
stripColor(out.toString()), stripAnsiCode(out.toString()),
`\ `\
(idx) a b c (idx) a b c
@ -1829,7 +1834,7 @@ Deno.test(function consoleLogShouldNotThrowError() {
Deno.test(function consoleLogShouldNotThrowErrorWhenInvalidCssColorsAreGiven() { Deno.test(function consoleLogShouldNotThrowErrorWhenInvalidCssColorsAreGiven() {
mockConsole((console, out) => { mockConsole((console, out) => {
console.log("%cfoo", "color: foo; background-color: bar;"); console.log("%cfoo", "color: foo; background-color: bar;");
assertEquals(stripColor(out.toString()), "foo\n"); assertEquals(stripAnsiCode(out.toString()), "foo\n");
}); });
}); });
@ -1838,7 +1843,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInvalidDateIsPassed() {
mockConsole((console, out) => { mockConsole((console, out) => {
const invalidDate = new Date("test"); const invalidDate = new Date("test");
console.log(invalidDate); console.log(invalidDate);
assertEquals(stripColor(out.toString()), "Invalid Date\n"); assertEquals(stripAnsiCode(out.toString()), "Invalid Date\n");
}); });
}); });
@ -1847,7 +1852,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedSet() {
mockConsole((console, out) => { mockConsole((console, out) => {
const proxiedSet = new Proxy(new Set([1, 2]), {}); const proxiedSet = new Proxy(new Set([1, 2]), {});
console.log(proxiedSet); console.log(proxiedSet);
assertEquals(stripColor(out.toString()), "Set(2) { 1, 2 }\n"); assertEquals(stripAnsiCode(out.toString()), "Set(2) { 1, 2 }\n");
}); });
}); });
@ -1856,7 +1861,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedMap() {
mockConsole((console, out) => { mockConsole((console, out) => {
const proxiedMap = new Proxy(new Map([[1, 1], [2, 2]]), {}); const proxiedMap = new Proxy(new Map([[1, 1], [2, 2]]), {});
console.log(proxiedMap); console.log(proxiedMap);
assertEquals(stripColor(out.toString()), "Map(2) { 1 => 1, 2 => 2 }\n"); assertEquals(stripAnsiCode(out.toString()), "Map(2) { 1 => 1, 2 => 2 }\n");
}); });
}); });
@ -1865,7 +1870,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedTypedArray() {
mockConsole((console, out) => { mockConsole((console, out) => {
const proxiedUint8Array = new Proxy(new Uint8Array([1, 2]), {}); const proxiedUint8Array = new Proxy(new Uint8Array([1, 2]), {});
console.log(proxiedUint8Array); console.log(proxiedUint8Array);
assertEquals(stripColor(out.toString()), "Uint8Array(2) [ 1, 2 ]\n"); assertEquals(stripAnsiCode(out.toString()), "Uint8Array(2) [ 1, 2 ]\n");
}); });
}); });
@ -1874,7 +1879,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedRegExp() {
mockConsole((console, out) => { mockConsole((console, out) => {
const proxiedRegExp = new Proxy(/aaaa/, {}); const proxiedRegExp = new Proxy(/aaaa/, {});
console.log(proxiedRegExp); console.log(proxiedRegExp);
assertEquals(stripColor(out.toString()), "/aaaa/\n"); assertEquals(stripAnsiCode(out.toString()), "/aaaa/\n");
}); });
}); });
@ -1883,7 +1888,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedDate() {
mockConsole((console, out) => { mockConsole((console, out) => {
const proxiedDate = new Proxy(new Date("2022-09-24T15:59:39.529Z"), {}); const proxiedDate = new Proxy(new Date("2022-09-24T15:59:39.529Z"), {});
console.log(proxiedDate); console.log(proxiedDate);
assertEquals(stripColor(out.toString()), "2022-09-24T15:59:39.529Z\n"); assertEquals(stripAnsiCode(out.toString()), "2022-09-24T15:59:39.529Z\n");
}); });
}); });
@ -1892,7 +1897,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedError() {
mockConsole((console, out) => { mockConsole((console, out) => {
const proxiedError = new Proxy(new Error("message"), {}); const proxiedError = new Proxy(new Error("message"), {});
console.log(proxiedError); console.log(proxiedError);
assertStringIncludes(stripColor(out.toString()), "Error: message\n"); assertStringIncludes(stripAnsiCode(out.toString()), "Error: message\n");
}); });
}); });
@ -1931,18 +1936,18 @@ Deno.test(function consoleTrace() {
Deno.test(function inspectString() { Deno.test(function inspectString() {
assertEquals( assertEquals(
stripColor(Deno.inspect("\0")), stripAnsiCode(Deno.inspect("\0")),
`"\\x00"`, `"\\x00"`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect("\x1b[2J")), stripAnsiCode(Deno.inspect("\x1b[2J")),
`"\\x1b[2J"`, `"\\x1b[2J"`,
); );
}); });
Deno.test(function inspectGetters() { Deno.test(function inspectGetters() {
assertEquals( assertEquals(
stripColor(Deno.inspect({ stripAnsiCode(Deno.inspect({
get foo() { get foo() {
return 0; return 0;
}, },
@ -1951,7 +1956,7 @@ Deno.test(function inspectGetters() {
); );
assertEquals( assertEquals(
stripColor(Deno.inspect({ stripAnsiCode(Deno.inspect({
get foo() { get foo() {
return 0; return 0;
}, },
@ -1976,15 +1981,15 @@ Deno.test(function inspectPrototype() {
Deno.test(function inspectSorted() { Deno.test(function inspectSorted() {
assertEquals( assertEquals(
stripColor(Deno.inspect({ b: 2, a: 1 }, { sorted: true })), stripAnsiCode(Deno.inspect({ b: 2, a: 1 }, { sorted: true })),
"{ a: 1, b: 2 }", "{ a: 1, b: 2 }",
); );
assertEquals( assertEquals(
stripColor(Deno.inspect(new Set(["b", "a"]), { sorted: true })), stripAnsiCode(Deno.inspect(new Set(["b", "a"]), { sorted: true })),
`Set(2) { "a", "b" }`, `Set(2) { "a", "b" }`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Map([ new Map([
["b", 2], ["b", 2],
["a", 1], ["a", 1],
@ -1997,7 +2002,7 @@ Deno.test(function inspectSorted() {
Deno.test(function inspectTrailingComma() { Deno.test(function inspectTrailingComma() {
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
[ [
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
@ -2010,7 +2015,7 @@ Deno.test(function inspectTrailingComma() {
]`, ]`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
{ {
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 1, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 1,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 2, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 2,
@ -2023,7 +2028,7 @@ Deno.test(function inspectTrailingComma() {
}`, }`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Set([ new Set([
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
@ -2036,7 +2041,7 @@ Deno.test(function inspectTrailingComma() {
}`, }`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Map([ new Map([
["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 1], ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 1],
["bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 2], ["bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 2],
@ -2052,7 +2057,7 @@ Deno.test(function inspectTrailingComma() {
Deno.test(function inspectCompact() { Deno.test(function inspectCompact() {
assertEquals( assertEquals(
stripColor(Deno.inspect({ a: 1, b: 2 }, { compact: false })), stripAnsiCode(Deno.inspect({ a: 1, b: 2 }, { compact: false })),
`{ `{
a: 1, a: 1,
b: 2 b: 2
@ -2062,15 +2067,15 @@ Deno.test(function inspectCompact() {
Deno.test(function inspectIterableLimit() { Deno.test(function inspectIterableLimit() {
assertEquals( assertEquals(
stripColor(Deno.inspect(["a", "b", "c"], { iterableLimit: 2 })), stripAnsiCode(Deno.inspect(["a", "b", "c"], { iterableLimit: 2 })),
`[ "a", "b", ... 1 more item ]`, `[ "a", "b", ... 1 more item ]`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect(new Set(["a", "b", "c"]), { iterableLimit: 2 })), stripAnsiCode(Deno.inspect(new Set(["a", "b", "c"]), { iterableLimit: 2 })),
`Set(3) { "a", "b", ... 1 more item }`, `Set(3) { "a", "b", ... 1 more item }`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Map([ new Map([
["a", 1], ["a", 1],
["b", 2], ["b", 2],
@ -2084,19 +2089,19 @@ Deno.test(function inspectIterableLimit() {
Deno.test(function inspectProxy() { Deno.test(function inspectProxy() {
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy([1, 2, 3], {}), new Proxy([1, 2, 3], {}),
)), )),
"[ 1, 2, 3 ]", "[ 1, 2, 3 ]",
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy({ key: "value" }, {}), new Proxy({ key: "value" }, {}),
)), )),
`{ key: "value" }`, `{ key: "value" }`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy({}, { new Proxy({}, {
get(_target, key) { get(_target, key) {
if (key === Symbol.toStringTag) { if (key === Symbol.toStringTag) {
@ -2120,14 +2125,14 @@ Deno.test(function inspectProxy() {
`Object [MyProxy] { prop1: 5, prop2: 5 }`, `Object [MyProxy] { prop1: 5, prop2: 5 }`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy([1, 2, 3], { get() {} }), new Proxy([1, 2, 3], { get() {} }),
{ showProxy: true }, { showProxy: true },
)), )),
"Proxy [ [ 1, 2, 3 ], { get: [Function: get] } ]", "Proxy [ [ 1, 2, 3 ], { get: [Function: get] } ]",
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy({ a: 1 }, { new Proxy({ a: 1 }, {
set(): boolean { set(): boolean {
return false; return false;
@ -2138,7 +2143,7 @@ Deno.test(function inspectProxy() {
"Proxy [ { a: 1 }, { set: [Function: set] } ]", "Proxy [ { a: 1 }, { set: [Function: set] } ]",
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy([1, 2, 3, 4, 5, 6, 7], { get() {} }), new Proxy([1, 2, 3, 4, 5, 6, 7], { get() {} }),
{ showProxy: true }, { showProxy: true },
)), )),
@ -2151,7 +2156,7 @@ Deno.test(function inspectProxy() {
]`, ]`,
); );
assertEquals( assertEquals(
stripColor(Deno.inspect( stripAnsiCode(Deno.inspect(
new Proxy(function fn() {}, { get() {} }), new Proxy(function fn() {}, { get() {} }),
{ showProxy: true }, { showProxy: true },
)), )),
@ -2166,15 +2171,15 @@ Deno.test(function inspectError() {
}); });
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error1)), stripAnsiCode(Deno.inspect(error1)),
"Error: This is an error", "Error: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error2)), stripAnsiCode(Deno.inspect(error2)),
"Error: This is an error", "Error: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error2)), stripAnsiCode(Deno.inspect(error2)),
"Caused by Error: This is a cause error", "Caused by Error: This is a cause error",
); );
}); });
@ -2189,19 +2194,19 @@ Deno.test(function inspectErrorCircular() {
error2.cause.cause = error2; error2.cause.cause = error2;
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error1)), stripAnsiCode(Deno.inspect(error1)),
"Error: This is an error", "Error: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error2)), stripAnsiCode(Deno.inspect(error2)),
"<ref *1> Error: This is an error", "<ref *1> Error: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error2)), stripAnsiCode(Deno.inspect(error2)),
"Caused by Error: This is a cause error", "Caused by Error: This is a cause error",
); );
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error2)), stripAnsiCode(Deno.inspect(error2)),
"Caused by [Circular *1]", "Caused by [Circular *1]",
); );
}); });
@ -2213,11 +2218,11 @@ Deno.test(function inspectErrorWithCauseFormat() {
}, },
}); });
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error)), stripAnsiCode(Deno.inspect(error)),
"Error: This is an error", "Error: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor(Deno.inspect(error)), stripAnsiCode(Deno.inspect(error)),
"Caused by { code: 100500 }", "Caused by { code: 100500 }",
); );
}); });

View file

@ -8,7 +8,7 @@ import {
fail, fail,
unimplemented, unimplemented,
} from "./test_util.ts"; } from "./test_util.ts";
import { Buffer } from "@std/io/buffer.ts"; import { Buffer } from "@std/io/buffer";
const listenPort = 4506; const listenPort = 4506;

View file

@ -8,7 +8,7 @@ import {
assertRejects, assertRejects,
assertThrows, assertThrows,
} from "./test_util.ts"; } from "./test_util.ts";
import { copy } from "@std/io/copy.ts"; import { copy } from "@std/io/copy";
// Note tests for Deno.FsFile.setRaw is in integration tests. // Note tests for Deno.FsFile.setRaw is in integration tests.

View file

@ -2,7 +2,7 @@
// deno-lint-ignore-file no-deprecated-deno-api // deno-lint-ignore-file no-deprecated-deno-api
import { Buffer, BufReader, BufWriter } from "@std/io/mod.ts"; import { Buffer, BufReader, BufWriter } from "@std/io";
import { TextProtoReader } from "../testdata/run/textproto.ts"; import { TextProtoReader } from "../testdata/run/textproto.ts";
import { import {
assert, assert,
@ -13,7 +13,7 @@ import {
delay, delay,
fail, fail,
} from "./test_util.ts"; } from "./test_util.ts";
import { join } from "@std/path/mod.ts"; import { join } from "@std/path";
const listenPort = 4507; const listenPort = 4507;
const listenPort2 = 4508; const listenPort2 = 4508;

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "./test_util.ts"; import { assertEquals } from "./test_util.ts";
import { Buffer } from "@std/io/buffer.ts"; import { Buffer } from "@std/io/buffer";
const DEFAULT_BUF_SIZE = 32 * 1024; const DEFAULT_BUF_SIZE = 32 * 1024;

View file

@ -7,7 +7,7 @@ import {
assertRejects, assertRejects,
assertThrows, assertThrows,
} from "./test_util.ts"; } from "./test_util.ts";
import { assertType, IsExact } from "@std/testing/types.ts"; import { assertType, IsExact } from "@std/testing/types";
const sleep = (time: number) => new Promise((r) => setTimeout(r, time)); const sleep = (time: number) => new Promise((r) => setTimeout(r, time));

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// NOTE: these are just sometests to test the TypeScript types. Real coverage is // NOTE: these are just sometests to test the TypeScript types. Real coverage is
// provided by WPT. // provided by WPT.
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
Deno.test("messagechannel", async () => { Deno.test("messagechannel", async () => {
const mc = new MessageChannel(); const mc = new MessageChannel();

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertMatch, assertRejects } from "@std/assert/mod.ts"; import { assertMatch, assertRejects } from "@std/assert";
import { Buffer, BufReader, BufWriter } from "@std/io/mod.ts"; import { Buffer, BufReader, BufWriter } from "@std/io";
import { TextProtoReader } from "../testdata/run/textproto.ts"; import { TextProtoReader } from "../testdata/run/textproto.ts";
import { import {
assert, assert,

View file

@ -1,9 +1,9 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as colors from "@std/fmt/colors.ts"; import * as colors from "@std/fmt/colors";
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
export { colors }; export { colors };
import { join, resolve } from "@std/path/mod.ts"; import { join, resolve } from "@std/path";
export { export {
assert, assert,
assertEquals, assertEquals,
@ -20,10 +20,10 @@ export {
fail, fail,
unimplemented, unimplemented,
unreachable, unreachable,
} from "@std/assert/mod.ts"; } from "@std/assert";
export { delay } from "@std/async/delay.ts"; export { delay } from "@std/async/delay";
export { readLines } from "@std/io/read_lines.ts"; export { readLines } from "@std/io/read-lines";
export { parse as parseArgs } from "@std/flags/mod.ts"; export { parseArgs } from "@std/cli/parse-args";
export function pathToAbsoluteFileUrl(path: string): URL { export function pathToAbsoluteFileUrl(path: string): URL {
path = resolve(path); path = resolve(path);

View file

@ -7,9 +7,9 @@ import {
assertStrictEquals, assertStrictEquals,
assertThrows, assertThrows,
} from "./test_util.ts"; } from "./test_util.ts";
import { BufReader, BufWriter } from "@std/io/mod.ts"; import { BufReader, BufWriter } from "@std/io";
import { readAll } from "@std/io/read_all.ts"; import { readAll } from "@std/io/read-all";
import { writeAll } from "@std/io/write_all.ts"; import { writeAll } from "@std/io/write-all";
import { TextProtoReader } from "../testdata/run/textproto.ts"; import { TextProtoReader } from "../testdata/run/textproto.ts";
const encoder = new TextEncoder(); const encoder = new TextEncoder();

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals } from "./test_util.ts"; import { assert, assertEquals } from "./test_util.ts";
import { assertType, IsExact } from "@std/testing/types.ts"; import { assertType, IsExact } from "@std/testing/types";
Deno.test(function urlPatternFromString() { Deno.test(function urlPatternFromString() {
const pattern = new URLPattern("https://deno.land/foo/:bar"); const pattern = new URLPattern("https://deno.land/foo/:bar");

View file

@ -6,7 +6,7 @@ import {
assertRejects, assertRejects,
assertThrows, assertThrows,
unreachable, unreachable,
} from "@std/assert/mod.ts"; } from "@std/assert";
Deno.test("fragment", () => { Deno.test("fragment", () => {
assertThrows(() => new WebSocketStream("ws://localhost:4242/#")); assertThrows(() => new WebSocketStream("ws://localhost:4242/#"));

View file

@ -2,12 +2,7 @@
// Requires to be run with `--allow-net` flag // Requires to be run with `--allow-net` flag
import { import { assert, assertEquals, assertMatch, assertThrows } from "@std/assert";
assert,
assertEquals,
assertMatch,
assertThrows,
} from "@std/assert/mod.ts";
function resolveWorker(worker: string): string { function resolveWorker(worker: string): string {
return import.meta.resolve(`../testdata/workers/${worker}`); return import.meta.resolve(`../testdata/workers/${worker}`);

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as fs from "node:fs"; import * as fs from "node:fs";
import { assertRejects, assertThrows } from "@std/assert/mod.ts"; import { assertRejects, assertThrows } from "@std/assert";
Deno.test( Deno.test(
"[node/fs.access] Uses the owner permission when the user is the owner", "[node/fs.access] Uses the owner permission when the user is the owner",

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; import { assertEquals, assertThrows, fail } from "@std/assert";
import { appendFile, appendFileSync } from "node:fs"; import { appendFile, appendFileSync } from "node:fs";
import { fromFileUrl } from "@std/path/mod.ts"; import { fromFileUrl } from "@std/path";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
const decoder = new TextDecoder("utf-8"); const decoder = new TextDecoder("utf-8");

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertRejects, assertThrows, fail } from "@std/assert/mod.ts"; import { assert, assertRejects, assertThrows, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { chmod, chmodSync } from "node:fs"; import { chmod, chmodSync } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { chown, chownSync } from "node:fs"; import { chown, chownSync } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertThrows, fail } from "@std/assert/mod.ts"; import { assert, assertThrows, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { close, closeSync } from "node:fs"; import { close, closeSync } from "node:fs";

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { copyFile, copyFileSync, cpSync, existsSync } from "node:fs"; import { copyFile, copyFileSync, cpSync, existsSync } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals, fail } from "@std/assert/mod.ts"; import { assert, assertEquals, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { Dir as DirOrig, type Dirent } from "node:fs"; import { Dir as DirOrig, type Dirent } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals, assertThrows } from "@std/assert/mod.ts"; import { assert, assertEquals, assertThrows } from "@std/assert";
import { Dirent as Dirent_ } from "node:fs"; import { Dirent as Dirent_ } from "node:fs";
// deno-lint-ignore no-explicit-any // deno-lint-ignore no-explicit-any

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals, assertStringIncludes } from "@std/assert/mod.ts"; import { assert, assertEquals, assertStringIncludes } from "@std/assert";
import { exists, existsSync } from "node:fs"; import { exists, existsSync } from "node:fs";
import { promisify } from "node:util"; import { promisify } from "node:util";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { fdatasync, fdatasyncSync } from "node:fs"; import { fdatasync, fdatasyncSync } from "node:fs";
Deno.test({ Deno.test({

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { fstat, fstatSync } from "node:fs"; import { fstat, fstatSync } from "node:fs";
import { fail } from "@std/assert/mod.ts"; import { fail } from "@std/assert";
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts"; import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
import type { BigIntStats, Stats } from "node:fs"; import type { BigIntStats, Stats } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { fsync, fsyncSync } from "node:fs"; import { fsync, fsyncSync } from "node:fs";
Deno.test({ Deno.test({

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; import { assertEquals, assertThrows, fail } from "@std/assert";
import { ftruncate, ftruncateSync } from "node:fs"; import { ftruncate, ftruncateSync } from "node:fs";
Deno.test({ Deno.test({

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; import { assertEquals, assertThrows, fail } from "@std/assert";
import { futimes, futimesSync } from "node:fs"; import { futimes, futimesSync } from "node:fs";
const randomDate = new Date(Date.now() + 1000); const randomDate = new Date(Date.now() + 1000);

View file

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import * as fs from "node:fs/promises"; import * as fs from "node:fs/promises";
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url)); const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
const testData = path.resolve(moduleDir, "testdata", "hello.txt"); const testData = path.resolve(moduleDir, "testdata", "hello.txt");

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { assert, assertEquals, fail } from "@std/assert/mod.ts"; import { assert, assertEquals, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { link, linkSync } from "node:fs"; import { link, linkSync } from "node:fs";

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { lstat, lstatSync } from "node:fs"; import { lstat, lstatSync } from "node:fs";
import { fail } from "@std/assert/mod.ts"; import { fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts"; import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
import type { BigIntStats, Stats } from "node:fs"; import type { BigIntStats, Stats } from "node:fs";

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { assert } from "@std/assert/mod.ts"; import { assert } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { existsSync, mkdir, mkdirSync } from "node:fs"; import { existsSync, mkdir, mkdirSync } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertRejects, assertThrows } from "@std/assert/mod.ts"; import { assert, assertRejects, assertThrows } from "@std/assert";
import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs"; import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs";
import { env } from "node:process"; import { env } from "node:process";
import { promisify } from "node:util"; import { promisify } from "node:util";

View file

@ -9,7 +9,7 @@ import {
O_TRUNC, O_TRUNC,
O_WRONLY, O_WRONLY,
} from "node:constants"; } from "node:constants";
import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; import { assertEquals, assertThrows, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { open, openSync } from "node:fs"; import { open, openSync } from "node:fs";
import { join, parse } from "node:path"; import { join, parse } from "node:path";

View file

@ -6,7 +6,7 @@ import {
assertFalse, assertFalse,
assertInstanceOf, assertInstanceOf,
assertThrows, assertThrows,
} from "@std/assert/mod.ts"; } from "@std/assert";
import { opendir, opendirSync } from "node:fs"; import { opendir, opendirSync } from "node:fs";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";

View file

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { promises, readFile, readFileSync } from "node:fs"; import { promises, readFile, readFileSync } from "node:fs";
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url)); const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
const testData = path.resolve(moduleDir, "testdata", "hello.txt"); const testData = path.resolve(moduleDir, "testdata", "hello.txt");

View file

@ -4,11 +4,11 @@ import {
assertFalse, assertFalse,
assertMatch, assertMatch,
assertStrictEquals, assertStrictEquals,
} from "@std/assert/mod.ts"; } from "@std/assert";
import { read, readSync } from "node:fs"; import { read, readSync } from "node:fs";
import { open, openSync } from "node:fs"; import { open, openSync } from "node:fs";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { closeSync } from "node:fs"; import { closeSync } from "node:fs";
async function readTest( async function readTest(

View file

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, assertNotEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, assertNotEquals, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { readdir, readdirSync } from "node:fs"; import { readdir, readdirSync } from "node:fs";
import { join } from "@std/path/mod.ts"; import { join } from "@std/path";
Deno.test({ Deno.test({
name: "ASYNC: reading empty directory", name: "ASYNC: reading empty directory",

View file

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { readlink, readlinkSync } from "node:fs"; import { readlink, readlinkSync } from "node:fs";
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
const testDir = Deno.makeTempDirSync(); const testDir = Deno.makeTempDirSync();
const oldname = path.join(testDir, "oldname"); const oldname = path.join(testDir, "oldname");

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { realpath, realpathSync } from "node:fs"; import { realpath, realpathSync } from "node:fs";

View file

@ -1,9 +1,9 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { rename, renameSync } from "node:fs"; import { rename, renameSync } from "node:fs";
import { existsSync } from "node:fs"; import { existsSync } from "node:fs";
import { join, parse } from "@std/path/mod.ts"; import { join, parse } from "@std/path";
Deno.test({ Deno.test({
name: "ASYNC: renaming a file", name: "ASYNC: renaming a file",

View file

@ -1,13 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { import { assertEquals, assertRejects, assertThrows, fail } from "@std/assert";
assertEquals,
assertRejects,
assertThrows,
fail,
} from "@std/assert/mod.ts";
import { rm, rmSync } from "node:fs"; import { rm, rmSync } from "node:fs";
import { existsSync } from "node:fs"; import { existsSync } from "node:fs";
import { join } from "@std/path/mod.ts"; import { join } from "@std/path";
Deno.test({ Deno.test({
name: "ASYNC: removing empty folder", name: "ASYNC: removing empty folder",

View file

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { rmdir, rmdirSync } from "node:fs"; import { rmdir, rmdirSync } from "node:fs";
import { existsSync } from "node:fs"; import { existsSync } from "node:fs";
import { join } from "@std/path/mod.ts"; import { join } from "@std/path";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
Deno.test({ Deno.test({

View file

@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { BigIntStats, stat, Stats, statSync } from "node:fs"; import { BigIntStats, stat, Stats, statSync } from "node:fs";
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
export function assertStats(actual: Stats, expected: Deno.FileInfo) { export function assertStats(actual: Stats, expected: Deno.FileInfo) {
assertEquals(actual.dev, expected.dev); assertEquals(actual.dev, expected.dev);

View file

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as fs from "node:fs"; import * as fs from "node:fs";
import { assertEquals, assertRejects } from "@std/assert/mod.ts"; import { assertEquals, assertRejects } from "@std/assert";
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
function assertStatFs( function assertStatFs(
statFs: fs.StatsFsBase<unknown>, statFs: fs.StatsFsBase<unknown>,

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertThrows, fail } from "@std/assert/mod.ts"; import { assert, assertThrows, fail } from "@std/assert";
import { symlink, symlinkSync } from "node:fs"; import { symlink, symlinkSync } from "node:fs";
Deno.test({ Deno.test({

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; import { assertEquals, assertThrows, fail } from "@std/assert";
import { truncate, truncateSync } from "node:fs"; import { truncate, truncateSync } from "node:fs";
Deno.test({ Deno.test({

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, fail } from "@std/assert/mod.ts"; import { assertEquals, fail } from "@std/assert";
import { existsSync } from "node:fs"; import { existsSync } from "node:fs";
import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { unlink, unlinkSync } from "node:fs"; import { unlink, unlinkSync } from "node:fs";

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; import { assertEquals, assertThrows, fail } from "@std/assert";
import { utimes, utimesSync } from "node:fs"; import { utimes, utimesSync } from "node:fs";
const randomDate = new Date(Date.now() + 1000); const randomDate = new Date(Date.now() + 1000);

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { unwatchFile, watch, watchFile } from "node:fs"; import { unwatchFile, watch, watchFile } from "node:fs";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
function wait(time: number) { function wait(time: number) {
return new Promise((resolve) => { return new Promise((resolve) => {

View file

@ -5,9 +5,9 @@ import {
assertNotEquals, assertNotEquals,
assertRejects, assertRejects,
assertThrows, assertThrows,
} from "@std/assert/mod.ts"; } from "@std/assert";
import { writeFile, writeFileSync } from "node:fs"; import { writeFile, writeFileSync } from "node:fs";
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
type TextEncodings = type TextEncodings =
| "ascii" | "ascii"

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { write, writeSync } from "node:fs"; import { write, writeSync } from "node:fs";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
const decoder = new TextDecoder("utf-8"); const decoder = new TextDecoder("utf-8");

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertStringIncludes } from "@std/assert/mod.ts"; import { assert, assertStringIncludes } from "@std/assert";
/** Asserts that an error thrown in a callback will not be wrongly caught. */ /** Asserts that an error thrown in a callback will not be wrongly caught. */
export async function assertCallbackErrorUncaught( export async function assertCallbackErrorUncaught(

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { stripColor } from "@std/fmt/colors.ts"; import { stripAnsiCode } from "@std/fmt/colors";
import { assert, assertStrictEquals } from "@std/assert/mod.ts"; import { assert, assertStrictEquals } from "@std/assert";
import { AssertionError } from "node:assert"; import { AssertionError } from "node:assert";
Deno.test({ Deno.test({
@ -31,7 +31,7 @@ Deno.test({
{ actual: 1, expected: 2, operator: "equal" }, { actual: 1, expected: 2, operator: "equal" },
); );
assertStrictEquals(err.name, "AssertionError"); assertStrictEquals(err.name, "AssertionError");
assertStrictEquals(stripColor(err.message), "1 equal 2"); assertStrictEquals(stripAnsiCode(err.message), "1 equal 2");
assertStrictEquals(err.generatedMessage, true); assertStrictEquals(err.generatedMessage, true);
assertStrictEquals(err.code, "ERR_ASSERTION"); assertStrictEquals(err.code, "ERR_ASSERTION");
assertStrictEquals(err.actual, 1); assertStrictEquals(err.actual, 1);
@ -51,7 +51,7 @@ Deno.test({
stackStartFn, stackStartFn,
}); });
assertStrictEquals(err.name, "AssertionError"); assertStrictEquals(err.name, "AssertionError");
assertStrictEquals(stripColor(err.message), `'deno' match /node/`); assertStrictEquals(stripAnsiCode(err.message), `'deno' match /node/`);
assertStrictEquals(err.generatedMessage, true); assertStrictEquals(err.generatedMessage, true);
assertStrictEquals(err.code, "ERR_ASSERTION"); assertStrictEquals(err.code, "ERR_ASSERTION");
assertStrictEquals(err.actual, "deno"); assertStrictEquals(err.actual, "deno");

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks"; import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
Deno.test(async function foo() { Deno.test(async function foo() {
const asyncLocalStorage = new AsyncLocalStorage(); const asyncLocalStorage = new AsyncLocalStorage();

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import { assertEquals, assertThrows } from "@std/assert/mod.ts"; import { assertEquals, assertThrows } from "@std/assert";
Deno.test({ Deno.test({
name: "[node/buffer] alloc fails if size is not a number", name: "[node/buffer] alloc fails if size is not a number",

View file

@ -9,8 +9,8 @@ import {
assertNotStrictEquals, assertNotStrictEquals,
assertStrictEquals, assertStrictEquals,
assertStringIncludes, assertStringIncludes,
} from "@std/assert/mod.ts"; } from "@std/assert";
import * as path from "@std/path/mod.ts"; import * as path from "@std/path";
const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP; const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP;

View file

@ -1,18 +1,18 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import vm from "node:vm"; import vm from "node:vm";
import { stripColor } from "@std/fmt/colors.ts"; import { stripAnsiCode } from "@std/fmt/colors";
import { assertStringIncludes } from "@std/assert/mod.ts"; import { assertStringIncludes } from "@std/assert";
Deno.test(function inspectCrossRealmObjects() { Deno.test(function inspectCrossRealmObjects() {
assertStringIncludes( assertStringIncludes(
stripColor( stripAnsiCode(
Deno.inspect(vm.runInNewContext(`new Error("This is an error")`)), Deno.inspect(vm.runInNewContext(`new Error("This is an error")`)),
), ),
"Error: This is an error", "Error: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor( stripAnsiCode(
Deno.inspect( Deno.inspect(
vm.runInNewContext(`new AggregateError([], "This is an error")`), vm.runInNewContext(`new AggregateError([], "This is an error")`),
), ),
@ -20,7 +20,7 @@ Deno.test(function inspectCrossRealmObjects() {
"AggregateError: This is an error", "AggregateError: This is an error",
); );
assertStringIncludes( assertStringIncludes(
stripColor( stripAnsiCode(
Deno.inspect(vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)), Deno.inspect(vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)),
), ),
"2018-12-10T02:26:59.002Z", "2018-12-10T02:26:59.002Z",

View file

@ -4,7 +4,7 @@ import crypto from "node:crypto";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import testVectors128 from "./gcmEncryptExtIV128.json" with { type: "json" }; import testVectors128 from "./gcmEncryptExtIV128.json" with { type: "json" };
import testVectors256 from "./gcmEncryptExtIV256.json" with { type: "json" }; import testVectors256 from "./gcmEncryptExtIV256.json" with { type: "json" };
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
const aesGcm = (bits: string, key: Uint8Array) => { const aesGcm = (bits: string, key: Uint8Array) => {
const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`; const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`;

View file

@ -3,7 +3,7 @@ import crypto from "node:crypto";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import { Readable } from "node:stream"; import { Readable } from "node:stream";
import { buffer, text } from "node:stream/consumers"; import { buffer, text } from "node:stream/consumers";
import { assertEquals, assertThrows } from "@std/assert/mod.ts"; import { assertEquals, assertThrows } from "@std/assert";
const rsaPrivateKey = Deno.readTextFileSync( const rsaPrivateKey = Deno.readTextFileSync(
new URL("../testdata/rsa_private.pem", import.meta.url), new URL("../testdata/rsa_private.pem", import.meta.url),

View file

@ -2,7 +2,7 @@
import { createHash, createHmac, getHashes } from "node:crypto"; import { createHash, createHmac, getHashes } from "node:crypto";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import { Readable } from "node:stream"; import { Readable } from "node:stream";
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert";
// https://github.com/denoland/deno/issues/18140 // https://github.com/denoland/deno/issues/18140
Deno.test({ Deno.test({

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { hkdfSync } from "node:crypto"; import { hkdfSync } from "node:crypto";
import { assertEquals } from "@std/assert/mod.ts"; import { assertEquals } from "@std/assert";
import { Buffer } from "node:buffer"; import { Buffer } from "node:buffer";
import nodeFixtures from "../testdata/crypto_digest_fixtures.json" with { import nodeFixtures from "../testdata/crypto_digest_fixtures.json" with {
type: "json", type: "json",

Some files were not shown because too many files have changed in this diff Show more