Skip to content

Commit 3b84e4a

Browse files
committed
more fix
1 parent 228edc3 commit 3b84e4a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

lib/event_processor/batch_event_processor.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import { ServiceState, StartupLog } from '../service';
2929
import { LogLevel } from '../logging/logger';
3030
import { IdGenerator } from '../utils/id_generator';
3131

32+
vi.mock('../utils/executor/backoff_retry_runner', { spy: true });
33+
3234
const getMockDispatcher = () => {
3335
return {
3436
dispatchEvent: vi.fn(),
@@ -1124,6 +1126,12 @@ describe('BatchEventProcessor', async () => {
11241126
});
11251127

11261128
describe('stop', () => {
1129+
const runWithRetrySpy = retry.runWithRetry as unknown as MockInstance<typeof retry.runWithRetry>;
1130+
1131+
beforeEach(() => {
1132+
runWithRetrySpy.mockClear();
1133+
});
1134+
11271135
it('should reject onRunning if stop is called before the processor is started', async () => {
11281136
const eventDispatcher = getMockDispatcher();
11291137
const dispatchRepeater = getMockRepeater();
@@ -1194,7 +1202,6 @@ describe('BatchEventProcessor', async () => {
11941202
});
11951203

11961204
it('should cancel retry of active dispatches', async () => {
1197-
const runWithRetrySpy = vi.spyOn(retry, 'runWithRetry');
11981205
const cancel1 = vi.fn();
11991206
const cancel2 = vi.fn();
12001207
runWithRetrySpy.mockReturnValueOnce({

vitest.browser.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default defineConfig({
113113
// pool: 'forks', // Use forks pool to avoid threading issues with BrowserStack
114114
// bail: 1, // Stop on first failure to avoid cascading errors
115115
// Include all .spec.ts files in lib directory, but exclude react_native tests
116-
include: ['lib/**/event_processor_factory.browser.spec.ts'],
116+
include: ['lib/**/batch_event_processor.spec.ts'],
117117
exclude: [
118118
'lib/**/*.react_native.spec.ts',
119119
'lib/**/*.node.spec.ts',

vitest.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineConfig({
2626
test: {
2727
onConsoleLog: () => true,
2828
environment: 'happy-dom',
29-
include: ['**/lib/**/event_processor_factory.browser.spec.ts'],
29+
include: ['**/*.spec.ts'],
3030
typecheck: {
3131
enabled: true,
3232
tsconfig: 'tsconfig.spec.json',

0 commit comments

Comments
 (0)