Skip to content

Commit

Permalink
Add Honeybadger configuration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwebbio committed Aug 30, 2022
1 parent 87a14ee commit 7785842
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Honeybadger from '@honeybadger-io/js';
import { describe, expect, jest, test } from '@jest/globals';
import nock from 'nock';
import { Blob } from 'node-fetch';
Expand Down Expand Up @@ -65,4 +66,18 @@ describe('entrypoint', () => {
expect(secondaryHostClient2.uploadBackup).toHaveBeenCalledTimes(1);
expect(secondaryHostClient2.uploadBackup).toHaveBeenCalledWith(backupData);
});

describe('Honeybadger', () => {
test('to be configured', async () => {
const honeybadgerApiKey = jest
.spyOn(Config, 'honeybadgerApiKey', 'get')
.mockReturnValue('blablabla');
const honeybadgerConfigure = jest.spyOn(Honeybadger, 'configure');

await expect(import('./index')).rejects.toBeDefined();

expect(honeybadgerApiKey).toHaveBeenCalled();
expect(honeybadgerConfigure).toHaveBeenCalledWith({ apiKey: 'blablabla' });
});
});
});

0 comments on commit 7785842

Please sign in to comment.