Skip to content

Commit

Permalink
jest 29
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed May 6, 2024
1 parent 6b02045 commit 78221f5
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 96 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-license": "^3.3.1",
"size-limit": "~11.1.0",
"ts-jest": "^27.1.4",
"ts-jest": "^29.0.0",
"ts-node": "10.9.1",
"typedoc": "^0.18.0",
"typescript": "4.9.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-utils/src/metrics/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SentrySpan } from '@sentry/core';
import { spanToJSON, startInactiveSpan, withActiveSpan } from '@sentry/core';
import type { Span, SpanTimeInput, StartSpanOptions } from '@sentry/types';
import { WINDOW } from './types';
import { WINDOW } from '../types';

/**
* Checks if a given value is a valid measurement value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ describe('Integration | errorSampleRate', () => {
* sampling since we can load a saved session that did not have an error (and
* thus no replay was created).
*/
it('sends a replay after loading the session from storage', async () => {
it.only('sends a replay after loading the session from storage', async () => {
// Pretend that a session is already saved before loading replay
WINDOW.sessionStorage.setItem(
REPLAY_SESSION_KEY,
Expand All @@ -946,6 +946,8 @@ describe('Integration | errorSampleRate', () => {
integration['_initialize']();
const optionsEvent = createOptionsEvent(replay);

await vi.runAllTimersAsync();

const TEST_EVENT = getTestEventIncremental({ timestamp: BASE_TIMESTAMP });
mockRecord._emitter(TEST_EVENT);

Expand All @@ -957,6 +959,8 @@ describe('Integration | errorSampleRate', () => {
await vi.advanceTimersToNextTimerAsync();
await vi.advanceTimersToNextTimerAsync();

await vi.runAllTimersAsync();

// Buffered events before error
expect(replay).toHaveSentReplay({
recordingPayloadHeader: { segment_id: 0 },
Expand Down

0 comments on commit 78221f5

Please sign in to comment.