diff options
-rw-r--r-- | std/hash/sha1_test.ts | 5 | ||||
-rw-r--r-- | std/hash/sha256_test.ts | 5 | ||||
-rw-r--r-- | std/hash/sha512_test.ts | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/std/hash/sha1_test.ts b/std/hash/sha1_test.ts index 25571947f..89c60fe52 100644 --- a/std/hash/sha1_test.ts +++ b/std/hash/sha1_test.ts @@ -1,9 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { assertEquals } from "../testing/asserts.ts"; import { Sha1, Message } from "./sha1.ts"; -import { join, resolve } from "../path/mod.ts"; +import { dirname, join, resolve, fromFileUrl } from "../path/mod.ts"; -const testdataDir = resolve("hash", "testdata"); +const moduleDir = dirname(fromFileUrl(import.meta.url)); +const testdataDir = resolve(moduleDir, "testdata"); /** Handy function to convert an array/array buffer to a string of hex values. */ function toHexString(value: number[] | ArrayBuffer): string { diff --git a/std/hash/sha256_test.ts b/std/hash/sha256_test.ts index ba7efe4d1..fd9c227f4 100644 --- a/std/hash/sha256_test.ts +++ b/std/hash/sha256_test.ts @@ -1,9 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Sha256, HmacSha256, Message } from "./sha256.ts"; import { assertEquals } from "../testing/asserts.ts"; -import { join, resolve } from "../path/mod.ts"; +import { dirname, join, resolve, fromFileUrl } from "../path/mod.ts"; -const testdataDir = resolve("hash", "testdata"); +const moduleDir = dirname(fromFileUrl(import.meta.url)); +const testdataDir = resolve(moduleDir, "testdata"); /** Handy function to convert an array/array buffer to a string of hex values. */ function toHexString(value: number[] | ArrayBuffer): string { diff --git a/std/hash/sha512_test.ts b/std/hash/sha512_test.ts index d8d69a923..ee49a229d 100644 --- a/std/hash/sha512_test.ts +++ b/std/hash/sha512_test.ts @@ -1,9 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Sha512, HmacSha512, Message } from "./sha512.ts"; import { assertEquals } from "../testing/asserts.ts"; -import { join, resolve } from "../path/mod.ts"; +import { dirname, join, resolve, fromFileUrl } from "../path/mod.ts"; -const testdataDir = resolve("hash", "testdata"); +const moduleDir = dirname(fromFileUrl(import.meta.url)); +const testdataDir = resolve(moduleDir, "testdata"); /** Handy function to convert an array/array buffer to a string of hex values. */ function toHexString(value: number[] | ArrayBuffer): string { |