Skip to content

test(node): Ensure test dates use UTC consistently #14953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2025
Merged
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
14 changes: 7 additions & 7 deletions packages/node/test/integrations/request-session-tracking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('recordRequestSession()', () => {
const client = createTestClient();
const sendSessionSpy = jest.spyOn(client, 'sendSession');

jest.setSystemTime(new Date('March 19, 1999 06:12:34'));
jest.setSystemTime(new Date('March 19, 1999 06:12:34 UTC'));

simulateRequest(client, 'ok');

Expand All @@ -25,7 +25,7 @@ describe('recordRequestSession()', () => {
const client = createTestClient();
const sendSessionSpy = jest.spyOn(client, 'sendSession');

jest.setSystemTime(new Date('March 19, 1999 06:12:34'));
jest.setSystemTime(new Date('March 19, 1999 06:12:34 UTC'));

simulateRequest(client, 'crashed');

Expand All @@ -40,7 +40,7 @@ describe('recordRequestSession()', () => {
const client = createTestClient();
const sendSessionSpy = jest.spyOn(client, 'sendSession');

jest.setSystemTime(new Date('March 19, 1999 06:12:34'));
jest.setSystemTime(new Date('March 19, 1999 06:12:34 UTC'));

simulateRequest(client, 'errored');

Expand All @@ -56,15 +56,15 @@ describe('recordRequestSession()', () => {

const sendSessionSpy = jest.spyOn(client, 'sendSession');

jest.setSystemTime(new Date('March 19, 1999 06:00:00'));
jest.setSystemTime(new Date('March 19, 1999 06:00:00 UTC'));

simulateRequest(client, 'ok');
simulateRequest(client, 'ok');
simulateRequest(client, 'crashed');
simulateRequest(client, 'errored');

// "Wait" 1+ second to get into new bucket
jest.setSystemTime(new Date('March 19, 1999 06:01:01'));
jest.setSystemTime(new Date('March 19, 1999 06:01:01 UTC'));

simulateRequest(client, 'ok');
simulateRequest(client, 'errored');
Expand All @@ -89,12 +89,12 @@ describe('recordRequestSession()', () => {

const sendSessionSpy = jest.spyOn(client, 'sendSession');

jest.setSystemTime(new Date('March 19, 1999 06:00:00'));
jest.setSystemTime(new Date('March 19, 1999 06:00:00 UTC'));

simulateRequest(client, 'ok');

// "Wait" 1+ second to get into new bucket
jest.setSystemTime(new Date('March 19, 1999 06:01:01'));
jest.setSystemTime(new Date('March 19, 1999 06:01:01 UTC'));

simulateRequest(client, 'ok');

Expand Down
Loading