Passed
Pull Request — main (#13)
by Pieter Epeüs
07:26 queued 03:47
created

src/logging/__tests__/sentry.unit.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 25
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 18
mnd 0
bc 0
fnc 3
dl 0
loc 25
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { expect, describe, it } from '@jest/globals';
2
import makeSentry from '../sentry.js';
3
4
describe('Test the sentry logging', () => {
5
    it('It should work with minimum info', () => {
6
        const logging = {
7
            dsn: 'https://[email protected]/1234567',
8
            release: '1.2.3',
9
        };
10
        const Sentry = makeSentry(logging);
11
        expect(Sentry.captureException).toBeDefined();
12
    });
13
14
    it('It should work with all details', () => {
15
        const logging = {
16
            dsn: 'https://[email protected]/1234567',
17
            release: '1.2.3',
18
            environment: 'production',
19
            tracesSampleRate: 1,
20
            debug: false,
21
        };
22
        const Sentry = makeSentry(logging);
23
        expect(Sentry.captureException).toBeDefined();
24
    });
25
});
26