diff options
author | Luca Casonato <hello@lcas.dev> | 2024-06-24 11:47:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 11:47:12 +0200 |
commit | 1e8a6b94b1dcf98a2ae4de97b3e98e7b3e4e8f7f (patch) | |
tree | 89ae2bc343dea6bf17ca9d512ea80b51540347ca /tests/node_compat/test.ts | |
parent | ff535061077d2b67e20154a7dfefe8ca92502c5a (diff) |
fix(ext/node): rewrite crypto.Hash (#24302)
Changes in this PR:
- Added new fixed size hash algorithms (blake2b512, blake2s256,
sha512-224, sha512-256, sha3-224, sha3-256, sha3-384, sha3-512, sm3)
- Added variable size hash algorithms (the concept), with the algorithms
shake128 and shake256
- Use cppgc instead of resources for the hasher
- Enable Node's crypto.Hash tests and fix found bugs
Diffstat (limited to 'tests/node_compat/test.ts')
-rw-r--r-- | tests/node_compat/test.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/node_compat/test.ts b/tests/node_compat/test.ts index 6f15f2d0b..939fdf52a 100644 --- a/tests/node_compat/test.ts +++ b/tests/node_compat/test.ts @@ -16,7 +16,7 @@ import { magenta } from "@std/fmt/colors.ts"; import { pooledMap } from "@std/async/pool.ts"; import { dirname, fromFileUrl, join } from "@std/path/mod.ts"; -import { fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert/mod.ts"; import { config, getPathsFromTestSuites, @@ -169,12 +169,14 @@ Deno.test("Node.js compatibility", async (t) => { function checkConfigTestFilesOrder(testFileLists: Array<string[]>) { for (const testFileList of testFileLists) { const sortedTestList = JSON.parse(JSON.stringify(testFileList)); - sortedTestList.sort(); - if (JSON.stringify(testFileList) !== JSON.stringify(sortedTestList)) { - throw new Error( - `File names in \`config.json\` are not correct order.`, - ); - } + sortedTestList.sort((a: string, b: string) => + a.toLowerCase().localeCompare(b.toLowerCase()) + ); + assertEquals( + testFileList, + sortedTestList, + "File names in `config.json` are not correct order.", + ); } } |