Skip to content

Commit a267d5f

Browse files
authored
ref: Move test files to test/ dir (getsentry/sentry-replay#322)
In order to align with sentry-javascript, move the tests into the `test` folder. ref getsentry/sentry-replay#311
1 parent de845a6 commit a267d5f

26 files changed

+58
-54
lines changed

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export default async (): Promise<Config.InitialOptions> => {
1212
}),
1313
setupFilesAfterEnv: ['./jest.setup.ts'],
1414
testEnvironment: 'jsdom',
15-
testMatch: ['<rootDir>/(src|worker)/**/*(*.)@(spec|test).ts'],
15+
testMatch: ['<rootDir>/test/**/*(*.)@(spec|test).ts'],
1616
};
1717
};

src/blockAllMedia.test.ts renamed to test/unit/blockAllMedia.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mockSdk } from '@test';
22

3-
import { Replay } from './';
3+
import { Replay } from '../../src';
44

55
let replay: Replay;
66

src/coreHandlers/handleFetch.test.ts renamed to test/unit/coreHandlers/handleFetch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mockSdk } from '@test';
22

3-
import { handleFetch } from './handleFetch';
3+
import { handleFetch } from '../../../src/coreHandlers/handleFetch';
44

55
jest.unmock('@sentry/browser');
66

src/coreHandlers/handleScope-unit.test.ts renamed to test/unit/coreHandlers/handleScope-unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getCurrentHub } from '@sentry/core';
22
import { mockSdk } from '@test';
33

4-
import * as HandleScope from './handleScope';
4+
import * as HandleScope from '../../../src/coreHandlers/handleScope';
55

66
let mockHandleScope: jest.MockedFunction<typeof HandleScope.handleScope>;
77

src/coreHandlers/handleScope.test.ts renamed to test/unit/coreHandlers/handleScope.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Breadcrumb, Scope } from '@sentry/types';
22

3-
import * as HandleScope from './handleScope';
3+
import * as HandleScope from '../../../src/coreHandlers/handleScope';
44

55
jest.spyOn(HandleScope, 'handleScope');
66
const mockHandleScope = HandleScope.handleScope as jest.MockedFunction<

src/createPerformanceEntry.test.ts renamed to test/unit/createPerformanceEntry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mockSdk } from '@test';
22

3-
import { createPerformanceEntries } from './createPerformanceEntry';
3+
import { createPerformanceEntries } from '../../src/createPerformanceEntry';
44

55
jest.unmock('@sentry/browser');
66

src/eventBuffer.test.ts renamed to test/unit/eventBuffer.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import 'jsdom-worker';
33
import { BASE_TIMESTAMP } from '@test';
44
import pako from 'pako';
55

6-
import { createEventBuffer, EventBufferCompressionWorker } from './eventBuffer';
6+
import {
7+
createEventBuffer,
8+
EventBufferCompressionWorker,
9+
} from './../../src/eventBuffer';
710

811
const TEST_EVENT = { data: {}, timestamp: BASE_TIMESTAMP, type: 3 };
912

src/flush.test.ts renamed to test/unit/flush.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as SentryUtils from '@sentry/utils';
22
import { BASE_TIMESTAMP, mockRrweb, mockSdk } from '@test';
33

4-
import { useFakeTimers } from './../test/utils/use-fake-timers';
5-
import { SESSION_IDLE_DURATION } from './session/constants';
6-
import { createPerformanceEntries } from './createPerformanceEntry';
7-
import { Replay } from './';
4+
import { Replay } from './../../src';
5+
import { createPerformanceEntries } from './../../src/createPerformanceEntry';
6+
import { SESSION_IDLE_DURATION } from './../../src/session/constants';
7+
import { useFakeTimers } from './../../test/utils/use-fake-timers';
88

99
useFakeTimers();
1010

src/index-errorSampleRate.test.ts renamed to test/unit/index-errorSampleRate.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { PerformanceEntryResource } from '@test/fixtures/performanceEntry/resour
77
import { resetSdkMock } from '@test/mocks';
88
import { DomHandler, MockTransportSend } from '@test/types';
99

10-
import { useFakeTimers } from './../test/utils/use-fake-timers';
10+
import { Replay } from './../../src';
1111
import {
1212
REPLAY_SESSION_KEY,
1313
VISIBILITY_CHANGE_TIMEOUT,
14-
} from './session/constants';
15-
import { Replay } from './';
14+
} from './../../src/session/constants';
15+
import { useFakeTimers } from './../utils/use-fake-timers';
1616

1717
useFakeTimers();
1818

src/index-handleGlobalEvent.test.ts renamed to test/unit/index-handleGlobalEvent.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { Error } from '@test/fixtures/error';
22
import { Transaction } from '@test/fixtures/transaction';
33
import { resetSdkMock } from '@test/mocks';
44

5-
import { useFakeTimers } from './../test/utils/use-fake-timers';
6-
import { REPLAY_EVENT_NAME } from './session/constants';
7-
import { Replay } from './';
5+
import { Replay } from './../../src';
6+
import { REPLAY_EVENT_NAME } from './../../src/session/constants';
7+
import { useFakeTimers } from './../utils/use-fake-timers';
88

99
useFakeTimers();
1010
let replay: Replay;

0 commit comments

Comments
 (0)