Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ test('should aggregate successful, crashed and erroneous sessions', async () =>
.ignore('transaction', 'event')
.unignore('sessions')
.expect({
sessions: {
aggregates: [
{
started: expect.any(String),
exited: 2,
errored: 1,
},
],
sessions: agg => {
// Sessions are bucketed by minute; tolerate splits across a minute boundary by summing.
const totals = agg.aggregates.reduce(
(acc, b) => ({
exited: acc.exited + (b.exited ?? 0),
errored: acc.errored + (b.errored ?? 0),
crashed: acc.crashed + (b.crashed ?? 0),
}),
{ exited: 0, errored: 0, crashed: 0 },
);
expect(totals).toEqual({ exited: 2, errored: 1, crashed: 0 });
},
})
.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ test('should aggregate successful sessions', async () => {
.ignore('transaction', 'event')
.unignore('sessions')
.expect({
sessions: {
aggregates: [
{
started: expect.any(String),
exited: 3,
},
],
sessions: agg => {
// Sessions are bucketed by minute; tolerate splits across a minute boundary by summing.
const totals = agg.aggregates.reduce(
(acc, b) => ({
exited: acc.exited + (b.exited ?? 0),
errored: acc.errored + (b.errored ?? 0),
crashed: acc.crashed + (b.crashed ?? 0),
}),
{ exited: 0, errored: 0, crashed: 0 },
);
expect(totals).toEqual({ exited: 3, errored: 0, crashed: 0 });
},
})
.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ test('should aggregate successful and crashed sessions', async () => {
.ignore('transaction', 'event')
.unignore('sessions')
.expect({
sessions: {
aggregates: [
{
started: expect.any(String),
exited: 2,
crashed: 1,
},
],
sessions: agg => {
// Sessions are bucketed by minute; tolerate splits across a minute boundary by summing.
const totals = agg.aggregates.reduce(
(acc, b) => ({
exited: acc.exited + (b.exited ?? 0),
errored: acc.errored + (b.errored ?? 0),
crashed: acc.crashed + (b.crashed ?? 0),
}),
{ exited: 0, errored: 0, crashed: 0 },
);
expect(totals).toEqual({ exited: 2, errored: 0, crashed: 1 });
},
})
.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ test('should aggregate successful, crashed and erroneous sessions', async () =>
.ignore('transaction', 'event')
.unignore('sessions')
.expect({
sessions: {
aggregates: [
{
started: expect.any(String),
exited: 1,
crashed: 1,
errored: 1,
},
],
sessions: agg => {
// Sessions are bucketed by minute; tolerate splits across a minute boundary by summing.
const totals = agg.aggregates.reduce(
(acc, b) => ({
exited: acc.exited + (b.exited ?? 0),
errored: acc.errored + (b.errored ?? 0),
crashed: acc.crashed + (b.crashed ?? 0),
}),
{ exited: 0, errored: 0, crashed: 0 },
);
expect(totals).toEqual({ exited: 1, errored: 1, crashed: 1 });
},
})
.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ test('should aggregate successful sessions', async () => {
.ignore('transaction', 'event')
.unignore('sessions')
.expect({
sessions: {
aggregates: [
{
started: expect.any(String),
exited: 3,
},
],
sessions: agg => {
// Sessions are bucketed by minute; tolerate splits across a minute boundary by summing.
const totals = agg.aggregates.reduce(
(acc, b) => ({
exited: acc.exited + (b.exited ?? 0),
errored: acc.errored + (b.errored ?? 0),
crashed: acc.crashed + (b.crashed ?? 0),
}),
{ exited: 0, errored: 0, crashed: 0 },
);
expect(totals).toEqual({ exited: 3, errored: 0, crashed: 0 });
},
})
.start();
Expand Down
Loading