Skip to content

Commit

Permalink
test: Update init tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jul 29, 2024
1 parent 61ad09f commit 87b4fa1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/cloudflare/test/sdk.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { describe, expect, test, vi } from 'vitest';

import * as SentryCore from '@sentry/core';
import { CloudflareClient } from '../src/client';
import { init } from '../src/sdk';

describe('init', () => {
test('should call initAndBind with the correct options', () => {
const initAndBindSpy = vi.spyOn(SentryCore, 'initAndBind');
init({});
const client = init({});

expect(initAndBindSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Object));
expect(initAndBindSpy).toHaveBeenCalledWith(CloudflareClient, expect.any(Object));

expect(client).toBeDefined();
expect(client).toBeInstanceOf(CloudflareClient);
});
});

0 comments on commit 87b4fa1

Please sign in to comment.