Skip to content

Commit bd306d7

Browse files
test: add nodejs_compat_v2 test for equivalence of getRandomValues (#6701)
1 parent 2507304 commit bd306d7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

fixtures/nodejs-hybrid-app/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
import nodeCrypto from "crypto";
12
// node:assert/strict is currently an unenv alias to node:assert
23
// this is not very common, but happens and we need to support it
34
import assert from "node:assert/strict";
45
import { Stream } from "node:stream";
56
import { Client } from "pg";
67
import { s } from "./dep.cjs";
78

9+
assert(
10+
nodeCrypto.webcrypto.getRandomValues === globalThis.crypto.getRandomValues,
11+
"Expected the imported and global webcrypto to be identical"
12+
);
13+
814
assert(s instanceof Stream, "expected s to be an instance of Stream");
915

1016
assert(true, "the world is broken");

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)