From 52b27aa5051f91b68c723fc5a9c16483df1a555a Mon Sep 17 00:00:00 2001 From: Yair Dovrat Date: Thu, 18 Jul 2024 15:49:48 +0200 Subject: [PATCH] add crypto to test file --- src/index.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.test.ts b/src/index.test.ts index 4f1e0f6..c0ead48 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,6 +1,10 @@ import { Client, MCEvent } from '@managed-components/types' import { vi, describe, it, expect, beforeEach } from 'vitest' import { onEvent } from '.' +import crypto from 'crypto' +if (!global.crypto) { + vi.stubGlobal('crypto', crypto) +} describe('Twitter Analytics MC', () => { let mockClient: Client