Skip to content

Commit 2c2b624

Browse files
author
Luca Forstner
committed
tests
1 parent b26727c commit 2c2b624

File tree

1 file changed

+94
-104
lines changed

1 file changed

+94
-104
lines changed

packages/integration-tests/fixtures/telemetry/telemetry.test.ts

Lines changed: 94 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -39,122 +39,112 @@ test("rollup bundle telemetry", async () => {
3939
// Ensure the session gets closed
4040
process.emit("beforeExit", 0);
4141

42-
expect(gbl.__SENTRY_INTERCEPT_TRANSPORT__).toEqual([
43-
// Fist we should have a session start
42+
expect(gbl.__SENTRY_INTERCEPT_TRANSPORT__).toEqual(
4443
expect.arrayContaining([
45-
[
44+
// Fist we should have a session start
45+
expect.arrayContaining([
4646
[
47-
{ type: "session" },
48-
expect.objectContaining({
49-
sid: expect.any(String),
50-
init: true,
51-
started: expect.any(String),
52-
timestamp: expect.any(String),
53-
status: "ok",
54-
errors: 0,
55-
}),
47+
[
48+
{ type: "session" },
49+
expect.objectContaining({
50+
sid: expect.any(String),
51+
init: true,
52+
started: expect.any(String),
53+
timestamp: expect.any(String),
54+
status: "ok",
55+
errors: 0,
56+
}),
57+
],
5658
],
57-
],
58-
]),
59-
// Then we should get a transaction for execution
60-
expect.arrayContaining([
61-
{
62-
event_id: expect.any(String),
63-
sent_at: expect.any(String),
64-
sdk: { name: "sentry.javascript.node", version: expect.any(String) },
65-
trace: expect.objectContaining({
66-
environment: "production",
67-
release: expect.any(String),
68-
sample_rate: "1",
69-
transaction: "Sentry Bundler Plugin execution",
70-
sampled: "true",
71-
}),
72-
},
73-
{
74-
event_id: expect.any(String),
75-
sent_at: expect.any(String),
76-
sdk: { name: "sentry.javascript.node", version: expect.any(String) },
77-
trace: expect.objectContaining({
78-
environment: "production",
79-
release: expect.any(String),
80-
sample_rate: "1",
81-
transaction: "debug-id-sourcemap-upload",
82-
sampled: "true",
83-
}),
84-
},
59+
]),
60+
// Then we should get a transaction for execution
8561
[
62+
{
63+
event_id: expect.any(String),
64+
sent_at: expect.any(String),
65+
sdk: { name: "sentry.javascript.node", version: expect.any(String) },
66+
trace: expect.objectContaining({
67+
environment: "production",
68+
release: expect.any(String),
69+
sample_rate: "1",
70+
transaction: "Sentry Bundler Plugin execution",
71+
sampled: "true",
72+
}),
73+
},
8674
[
87-
{ type: "transaction" },
88-
expect.objectContaining({
89-
contexts: {
90-
trace: {
91-
span_id: expect.any(String),
92-
trace_id: expect.any(String),
93-
data: {
94-
"sentry.origin": "manual",
95-
"sentry.source": "custom",
96-
"sentry.sample_rate": 1,
75+
[
76+
{ type: "transaction" },
77+
expect.objectContaining({
78+
contexts: {
79+
trace: {
80+
span_id: expect.any(String),
81+
trace_id: expect.any(String),
82+
data: {
83+
"sentry.origin": "manual",
84+
"sentry.source": "custom",
85+
"sentry.sample_rate": 1,
86+
},
87+
origin: "manual",
9788
},
98-
origin: "manual",
89+
runtime: { name: "node", version: expect.any(String) },
9990
},
100-
runtime: { name: "node", version: expect.any(String) },
101-
},
102-
spans: [],
103-
start_timestamp: expect.any(Number),
104-
timestamp: expect.any(Number),
105-
transaction: "Sentry Bundler Plugin execution",
106-
type: "transaction",
107-
transaction_info: { source: "custom" },
108-
platform: "node",
109-
event_id: expect.any(String),
110-
environment: "production",
111-
release: expect.any(String),
112-
tags: expect.objectContaining({
113-
"upload-legacy-sourcemaps": false,
114-
"module-metadata": false,
115-
"inject-build-information": false,
116-
"set-commits": "auto",
117-
"finalize-release": true,
118-
"deploy-options": false,
119-
"custom-error-handler": false,
120-
"sourcemaps-assets": false,
121-
"delete-after-upload": false,
122-
"sourcemaps-disabled": false,
123-
"react-annotate": false,
124-
"meta-framework": "none",
125-
"application-key-set": false,
126-
bundler: "rollup",
91+
spans: [],
92+
start_timestamp: expect.any(Number),
93+
timestamp: expect.any(Number),
94+
transaction: "Sentry Bundler Plugin execution",
95+
type: "transaction",
96+
transaction_info: { source: "custom" },
97+
platform: "node",
98+
event_id: expect.any(String),
99+
environment: "production",
100+
release: expect.any(String),
101+
tags: expect.objectContaining({
102+
"upload-legacy-sourcemaps": false,
103+
"module-metadata": false,
104+
"inject-build-information": false,
105+
"set-commits": "auto",
106+
"finalize-release": true,
107+
"deploy-options": false,
108+
"custom-error-handler": false,
109+
"sourcemaps-assets": false,
110+
"delete-after-upload": false,
111+
"sourcemaps-disabled": false,
112+
"react-annotate": false,
113+
"meta-framework": "none",
114+
"application-key-set": false,
115+
bundler: "rollup",
116+
}),
117+
sdk: expect.objectContaining({
118+
name: "sentry.javascript.node",
119+
version: expect.any(String),
120+
packages: [{ name: "npm:@sentry/node", version: expect.any(String) }],
121+
}),
127122
}),
128-
sdk: expect.objectContaining({
129-
name: "sentry.javascript.node",
130-
version: expect.any(String),
131-
packages: [{ name: "npm:@sentry/node", version: expect.any(String) }],
132-
}),
133-
}),
123+
],
134124
],
135125
],
136-
]),
137-
// Then we should get a session exit
138-
[
139-
{
140-
sent_at: expect.any(String),
141-
sdk: { name: "sentry.javascript.node", version: expect.any(String) },
142-
},
126+
// Then we should get a session exit
143127
[
128+
{
129+
sent_at: expect.any(String),
130+
sdk: { name: "sentry.javascript.node", version: expect.any(String) },
131+
},
144132
[
145-
{ type: "session" },
146-
{
147-
sid: expect.any(String),
148-
init: false,
149-
started: expect.any(String),
150-
timestamp: expect.any(String),
151-
status: "exited",
152-
errors: 0,
153-
duration: expect.any(Number),
154-
attrs: { release: expect.any(String), environment: "production" },
155-
},
133+
[
134+
{ type: "session" },
135+
{
136+
sid: expect.any(String),
137+
init: false,
138+
started: expect.any(String),
139+
timestamp: expect.any(String),
140+
status: "exited",
141+
errors: 0,
142+
duration: expect.any(Number),
143+
attrs: { release: expect.any(String), environment: "production" },
144+
},
145+
],
156146
],
157147
],
158-
],
159-
]);
148+
])
149+
);
160150
});

0 commit comments

Comments
 (0)