Skip to content

Commit 7fc8897

Browse files
committed
fix unit tests
1 parent 3d1323e commit 7fc8897

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

lib/core/audience_evaluator/index.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ describe('lib/core/audience_evaluator', () => {
354354

355355
it('logs correctly when conditionTreeEvaluator.evaluate returns false', () => {
356356
evaluateSpy.mockImplementationOnce((conditions: any, leafEvaluator) => {
357-
console.log('evaluateSpy leafEvaluator called with conditions:', conditions);
358357
return leafEvaluator(conditions[1]);
359358
});
360359

lib/core/audience_evaluator/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export class AudienceEvaluator {
3939
* @constructor
4040
*/
4141
constructor(UNSTABLE_conditionEvaluators: unknown, logger?: LoggerFacade) {
42-
43-
// console.log('AudienceEvaluator constructor called', customAttributeConditionEvaluator.getEvaluator());
4442
this.logger = logger;
4543
this.typeToEvaluatorMap = {
4644
...UNSTABLE_conditionEvaluators as any,

lib/core/bucketer/index.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('excluding groups', () => {
9494
});
9595

9696
afterEach(() => {
97-
vi.restoreAllMocks();
97+
vi.resetAllMocks();
9898
});
9999

100100
it('should return decision response with correct variation ID when provided bucket value', async () => {
@@ -142,7 +142,7 @@ describe('including groups: random', () => {
142142
});
143143

144144
afterEach(() => {
145-
vi.restoreAllMocks();
145+
vi.resetAllMocks();
146146
});
147147

148148
it('should return decision response with the proper variation for a user in a grouped experiment', () => {
@@ -248,7 +248,7 @@ describe('including groups: overlapping', () => {
248248
});
249249

250250
afterEach(() => {
251-
vi.restoreAllMocks();
251+
vi.resetAllMocks();
252252
});
253253

254254
it('should return decision response with variation when a user falls into an experiment within an overlapping group', () => {
@@ -301,7 +301,7 @@ describe('bucket value falls into empty traffic allocation ranges', () => {
301301
});
302302

303303
afterEach(() => {
304-
vi.restoreAllMocks();
304+
vi.resetAllMocks();
305305
});
306306

307307
it('should return decision response with variation null', () => {
@@ -351,7 +351,7 @@ describe('traffic allocation has invalid variation ids', () => {
351351
});
352352

353353
afterEach(() => {
354-
vi.restoreAllMocks();
354+
vi.resetAllMocks();
355355
});
356356

357357
it('should return decision response with variation null', () => {

vitest.browser.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export default defineConfig({
312312
testTimeout: 60000, // 60 seconds per test - if longer, something is wrong
313313
hookTimeout: 30000, // 30 seconds for hooks
314314
include: [
315-
'lib/**/**/*.spec.ts',
315+
'lib/**/*.spec.ts',
316316
],
317317
exclude: [
318318
'lib/**/*.react_native.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: ['**/audience_evaluator/*.spec.ts'],
29+
include: ['lib/**/*.spec.ts'],
3030
typecheck: {
3131
enabled: true,
3232
tsconfig: 'tsconfig.spec.json',

0 commit comments

Comments
 (0)