Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use isDenoV1 on test. #426

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/hpke-js/test/cipherSuiteNative.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals, assertRejects, assertThrows } from "@std/assert";
import { describe, it } from "@std/testing/bdd";

import { concat, hexToBytes, isNode, loadCrypto } from "@hpke/common";
import { concat, hexToBytes, isDenoV1, loadCrypto } from "@hpke/common";
import {
AeadId,
Aes128Gcm,
Expand Down Expand Up @@ -540,7 +540,7 @@ describe("deriveKeyPair", () => {

describe("with official test-vector for DhkemP256HkdfSha256.", () => {
it("should derive a proper key pair.", async () => {
if (!isNode()) {
if (isDenoV1()) {
return;
}
const ikmR = hexToBytes(
Expand Down
13 changes: 6 additions & 7 deletions packages/hpke-js/test/kemContext.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals, assertRejects } from "@std/assert";
import { describe, it } from "@std/testing/bdd";

import { isNode, loadCrypto } from "@hpke/common";
import { isDenoV1, isNode, loadCrypto } from "@hpke/common";
import {
DeriveKeyPairError,
DeserializeError,
Expand Down Expand Up @@ -152,7 +152,7 @@ describe("generateKeyPair", () => {
describe("deriveKeyPair", () => {
describe("with valid parameters", () => {
it("should return a proper instance with DhkemP256HkdfSha256", async () => {
if (!isNode()) {
if (isDenoV1()) {
return;
}
const cryptoApi = await loadCrypto();
Expand All @@ -176,7 +176,7 @@ describe("deriveKeyPair", () => {
});

it("should return a proper instance with DhkemP384HkdfSha384", async () => {
if (!isNode()) {
if (isDenoV1()) {
return;
}
const cryptoApi = await loadCrypto();
Expand Down Expand Up @@ -280,8 +280,7 @@ describe("deriveKeyPair", () => {

describe("with invalid parameters", () => {
it("should throw NotSupportedError with DhkemP256HkdfSha256", async () => {
// deno-lint-ignore no-explicit-any
if ((globalThis as any).process !== undefined) {
if (!isDenoV1()) {
return;
}
const cryptoApi = await loadCrypto();
Expand Down Expand Up @@ -491,7 +490,7 @@ describe("serialize/deserializePublicKey", () => {
describe("serialize/deserializePrivateKey", () => {
describe("with valid parameters", () => {
it("should return a proper instance with DhkemP256HkdfSha256", async () => {
if (!isNode()) {
if (isDenoV1()) {
return;
}

Expand All @@ -509,7 +508,7 @@ describe("serialize/deserializePrivateKey", () => {
});

it("should return a proper instance with DhkemP384HkdfSha384", async () => {
if (!isNode()) {
if (isDenoV1()) {
return;
}

Expand Down
Loading