function setEncryptionKeyForTest
setEncryptionKeyForTest(key: string | null): void

Explicitly set or clear the encryption key for testing. Bypasses Deno.env to avoid races between parallel test workers. Clears every crypto cache, including any registered by onEncryptionKeyChange.

Parameters

key: string | null

Return Type

void

Usage

import { setEncryptionKeyForTest } from "docs/crypto.ts";