-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
47 lines (42 loc) · 1.31 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import * as Pigeon from './index.js'
import { Severity } from '@sentry/types';
var assert = require('chai').assert;
const DSN = 'https://TEST:[email protected]/VAL';
describe('init', function() {
it('Should accept an empty DSN and consider itself disabled', function() {
Pigeon.init('');
});
it('Should correctly parse a real DSN', function() {
Pigeon.init({dsn: DSN});
});
});
describe('captureMessage', function() {
before(function() {
Pigeon.init({dsn: DSN});
});
it('Should be able to send a test message', function() {
let result = Pigeon.captureMessage("Test Message");
assert.notEqual(result, null);
});
});
describe('captureException', function() {
before(function() {
Pigeon.init({dsn: DSN});
});
it('Should be able to send a test exception', async function() {
let result = Pigeon.captureException(new Error("TEST Error"));
assert.notEqual(result, null);
});
});
describe('addBreadcrumb', function() {
before(function() {
Pigeon.init({dsn: DSN});
});
it('Should be able to add a breadcrumb to the context', async function() {
Pigeon.addBreadcrumb({
category: 'method',
message: 'Method "testmethod" was called',
level: Severity.Info
});
});
});