Skip to content

Commit

Permalink
test: Add node scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Oct 28, 2021
1 parent 79fa39f commit 94ef620
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scenarios/node/basic-custom-integration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const Sentry = require("@sentry/node");

class CustomIntegration {
static id = 'CustomIntegration';

name = CustomIntegration.id;
options = undefined;

constructor(options) {
this.options = options;
}

setupOnce(addGlobalEventProcessor, getCurrentHub) {
addGlobalEventProcessor(event => event);
const hub = getCurrentHub();
hub.captureMessage(options.name);
}
}

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
integrations: [new CustomIntegration()]
});
22 changes: 22 additions & 0 deletions scenarios/node/basic-custom-transport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const Sentry = require("@sentry/node");

class CustomTransport extends Sentry.Transports.BaseTransport {
constructor(options) {
super(options);
}

sendEvent(event) {
console.log("Sending Event");
return super.sendEvent(event);
}

sendSession(session) {
console.log("Sending Session");
return super.sendSession(session);
}
}

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
transport: CustomTransport,
});
6 changes: 6 additions & 0 deletions scenarios/node/basic-no-client-repors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
sendClientReports: false,
});
6 changes: 6 additions & 0 deletions scenarios/node/basic-no-default-integrations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
defaultIntegrations: false,
});
3 changes: 3 additions & 0 deletions scenarios/node/basic-no-dsn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const Sentry = require("@sentry/node");

Sentry.init();
7 changes: 7 additions & 0 deletions scenarios/node/basic-no-sessions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
release: "my-app@1.2.3",
autoSessionTracking: false,
});
6 changes: 6 additions & 0 deletions scenarios/node/basic-with-debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
debug: true,
});
6 changes: 6 additions & 0 deletions scenarios/node/basic-with-sessions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
release: "my-app@1.2.3",
});
5 changes: 5 additions & 0 deletions scenarios/node/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
});
13 changes: 13 additions & 0 deletions scenarios/node/perf-manual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Sentry = require("@sentry/node");
const _ = require("@sentry/tracing");

Sentry.init({
dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000",
tracesSampleRate: 1.0,
});

const transaction = Sentry.startTransaction({ op: "task", name: "Important Stuff" });

setTimeout(() => {
transaction.finish();
}, 1000);

0 comments on commit 94ef620

Please sign in to comment.