summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/crypto
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-07 09:51:28 -0700
committerGitHub <noreply@github.com>2024-02-07 09:51:28 -0700
commitffbb1bad037528863fcc191f0eaf374211252713 (patch)
tree9928b64886a34d5e12d22cf352371e8fc8d382b2 /cli/tests/unit_node/crypto
parent83d72e5c1c0b983f4b63f3f64f9a1de7600985f4 (diff)
chore(cli): Use @test_util for relative path for unit tests (#22327)
This removes the majority of `../../../../../../test_util` relative imports from the codebase, allowing us to move this code more easily in the future.
Diffstat (limited to 'cli/tests/unit_node/crypto')
-rw-r--r--cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts2
-rw-r--r--cli/tests/unit_node/crypto/crypto_cipher_test.ts5
-rw-r--r--cli/tests/unit_node/crypto/crypto_hash_test.ts2
-rw-r--r--cli/tests/unit_node/crypto/crypto_key_test.ts5
-rw-r--r--cli/tests/unit_node/crypto/crypto_sign_test.ts5
5 files changed, 5 insertions, 14 deletions
diff --git a/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts
index 6c500f9f2..b7b616546 100644
--- a/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts
+++ b/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts
@@ -4,7 +4,7 @@ import crypto from "node:crypto";
import { Buffer } from "node:buffer";
import testVectors128 from "./gcmEncryptExtIV128.json" assert { type: "json" };
import testVectors256 from "./gcmEncryptExtIV256.json" assert { type: "json" };
-import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
+import { assertEquals } from "@test_util/std/assert/mod.ts";
const aesGcm = (bits: string, key: Uint8Array) => {
const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`;
diff --git a/cli/tests/unit_node/crypto/crypto_cipher_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_test.ts
index 7ea361bf6..3da7ae3f1 100644
--- a/cli/tests/unit_node/crypto/crypto_cipher_test.ts
+++ b/cli/tests/unit_node/crypto/crypto_cipher_test.ts
@@ -3,10 +3,7 @@ import crypto from "node:crypto";
import { Buffer } from "node:buffer";
import { Readable } from "node:stream";
import { buffer, text } from "node:stream/consumers";
-import {
- assertEquals,
- assertThrows,
-} from "../../../../test_util/std/assert/mod.ts";
+import { assertEquals, assertThrows } from "@test_util/std/assert/mod.ts";
const rsaPrivateKey = Deno.readTextFileSync(
new URL("../testdata/rsa_private.pem", import.meta.url),
diff --git a/cli/tests/unit_node/crypto/crypto_hash_test.ts b/cli/tests/unit_node/crypto/crypto_hash_test.ts
index e1bb4de8a..ff1c9c598 100644
--- a/cli/tests/unit_node/crypto/crypto_hash_test.ts
+++ b/cli/tests/unit_node/crypto/crypto_hash_test.ts
@@ -8,7 +8,7 @@ import {
} from "node:crypto";
import { Buffer } from "node:buffer";
import { Readable } from "node:stream";
-import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
+import { assert, assertEquals } from "@test_util/std/assert/mod.ts";
// https://github.com/denoland/deno/issues/18140
Deno.test({
diff --git a/cli/tests/unit_node/crypto/crypto_key_test.ts b/cli/tests/unit_node/crypto/crypto_key_test.ts
index 3ad195df1..8d1b24b21 100644
--- a/cli/tests/unit_node/crypto/crypto_key_test.ts
+++ b/cli/tests/unit_node/crypto/crypto_key_test.ts
@@ -11,10 +11,7 @@ import {
} from "node:crypto";
import { promisify } from "node:util";
import { Buffer } from "node:buffer";
-import {
- assertEquals,
- assertThrows,
-} from "../../../../test_util/std/assert/mod.ts";
+import { assertEquals, assertThrows } from "@test_util/std/assert/mod.ts";
import { createHmac } from "node:crypto";
const RUN_SLOW_TESTS = Deno.env.get("SLOW_TESTS") === "1";
diff --git a/cli/tests/unit_node/crypto/crypto_sign_test.ts b/cli/tests/unit_node/crypto/crypto_sign_test.ts
index 000f2311a..287b54cc1 100644
--- a/cli/tests/unit_node/crypto/crypto_sign_test.ts
+++ b/cli/tests/unit_node/crypto/crypto_sign_test.ts
@@ -1,9 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import {
- assert,
- assertEquals,
-} from "../../../../test_util/std/testing/asserts.ts";
+import { assert, assertEquals } from "@test_util/std/testing/asserts.ts";
import { createSign, createVerify, sign, verify } from "node:crypto";
import { Buffer } from "node:buffer";