Move globalThis.crypto polyfill to fx.ts so it runs for all specs

This commit is contained in:
Asier Isayas
2026-08-13 15:18:34 -04:00
parent b98905f8be
commit bae4249590
2 changed files with 8 additions and 8 deletions
-7
View File
@@ -9,7 +9,6 @@ import {
JSONObject,
} from "@azure/cosmos";
import { Buffer } from "node:buffer";
import { webcrypto } from "node:crypto";
import {
generateUniqueName,
getAccountName,
@@ -19,12 +18,6 @@ import {
TestAccount,
} from "./fx";
// In Node.js >= 19, globalThis.crypto is already available as a read-only getter.
// Only assign the polyfill for older versions.
if (!globalThis.crypto) {
Object.defineProperty(globalThis, "crypto", { value: webcrypto, writable: true, configurable: true });
}
export interface TestItem {
id: string;
partitionKey: string;