Skip to content

Commit ed88939

Browse files
committed
remove redundant mock clear/reset
1 parent 88b9176 commit ed88939

File tree

6 files changed

+0
-25
lines changed

6 files changed

+0
-25
lines changed

tests/sdk/analytics.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import {analyticsProcessor, fetch} from './utils.js';
22

3-
afterEach(() => {
4-
vi.resetAllMocks();
5-
});
6-
73
test('test_analytics_processor_track_feature_updates_analytics_data', () => {
84
const aP = analyticsProcessor();
95
aP.trackFeature("myFeature");

tests/sdk/flagsmith-cache.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { fetch, environmentJSON, environmentModel, flagsJSON, flagsmith, identitiesJSON, TestCache } from './utils.js';
22

3-
beforeEach(() => {
4-
vi.clearAllMocks();
5-
});
6-
73
test('test_empty_cache_not_read_but_populated', async () => {
84
const cache = new TestCache();
95
const set = vi.spyOn(cache, 'set');

tests/sdk/flagsmith-environment-flags.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { DefaultFlag } from '../../sdk/models.js';
44

55
vi.mock('../../sdk/polling_manager');
66

7-
beforeEach(() => {
8-
vi.clearAllMocks();
9-
});
10-
117
test('test_get_environment_flags_calls_api_when_no_local_environment', async () => {
128
const flg = flagsmith();
139
const allFlags = await (await flg.getEnvironmentFlags()).allFlags();

tests/sdk/flagsmith-identity-flags.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import { DefaultFlag } from '../../sdk/models.js';
1212

1313
vi.mock('../../sdk/polling_manager');
1414

15-
beforeEach(() => {
16-
vi.clearAllMocks();
17-
});
18-
19-
2015
test('test_get_identity_flags_calls_api_when_no_local_environment_no_traits', async () => {
2116
const identifier = 'identifier';
2217

tests/sdk/flagsmith.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import { BaseOfflineHandler } from '../../sdk/offline_handlers.js';
1515
import { Agent } from 'undici';
1616

1717
vi.mock('../../sdk/polling_manager');
18-
beforeEach(() => {
19-
vi.clearAllMocks();
20-
});
21-
2218
test('test_flagsmith_starts_polling_manager_on_init_if_enabled', () => {
2319
new Flagsmith({
2420
environmentKey: 'ser.key',

tests/sdk/polling.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { EnvironmentDataPollingManager } from '../../sdk/polling_manager.js';
33
import { delay } from '../../sdk/utils.js';
44
vi.mock('../../sdk');
55

6-
beforeEach(() => {
7-
vi.clearAllMocks()
8-
});
9-
106
test('test_polling_manager_correctly_stops_if_never_started', async () => {
117
const flagsmith = new Flagsmith({
128
environmentKey: 'key'

0 commit comments

Comments
 (0)