mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 09:02:41 +01:00
Move globalThis.crypto polyfill to fx.ts so it runs for all specs
This commit is contained in:
+8
-1
@@ -1,8 +1,15 @@
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import { Frame, Locator, Page, expect } from "@playwright/test";
|
||||
import crypto from "crypto";
|
||||
import crypto, { webcrypto } from "crypto";
|
||||
import { TestContainerContext } from "./testData";
|
||||
|
||||
// The @azure/cosmos client signs requests with globalThis.crypto (Web Crypto API).
|
||||
// In Node.js >= 19 it's already available; only assign the polyfill for older versions.
|
||||
// This lives in fx.ts (imported by every spec) so the polyfill always runs.
|
||||
if (!globalThis.crypto) {
|
||||
Object.defineProperty(globalThis, "crypto", { value: webcrypto, writable: true, configurable: true });
|
||||
}
|
||||
|
||||
const RETRY_COUNT = 3;
|
||||
|
||||
export interface TestNameOptions {
|
||||
|
||||
Reference in New Issue
Block a user