55
66import { describe , expect , it } from 'vitest' ;
77import { SimpleExperimentationService } from '../src/main' ;
8+ import { DefaultsOnlyConfigurationService } from '../src/_internal/platform/configuration/common/defaultsOnlyConfigurationService' ;
89
910describe ( 'SimpleExperimentationService' , ( ) => {
1011 it ( 'should initialize with no treatment variables' , async ( ) => {
11- const service = new SimpleExperimentationService ( false ) ;
12+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
1213 await service . hasTreatments ( ) ;
1314
1415 expect ( service . getTreatmentVariable ( 'nonexistent' ) ) . toBeUndefined ( ) ;
@@ -17,7 +18,7 @@ describe('SimpleExperimentationService', () => {
1718 } ) ;
1819
1920 it ( 'should update multiple treatment variables at once' , ( ) => {
20- const service = new SimpleExperimentationService ( false ) ;
21+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
2122 const variables : Record < string , boolean | number | string > = {
2223 'feature-a' : true ,
2324 'feature-b' : false ,
@@ -36,7 +37,7 @@ describe('SimpleExperimentationService', () => {
3637 } ) ;
3738
3839 it ( 'should fire onDidTreatmentsChange event with all changed variables' , ( ) => {
39- const service = new SimpleExperimentationService ( false ) ;
40+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
4041 const events : string [ ] [ ] = [ ] ;
4142
4243 service . onDidTreatmentsChange ( ( event ) => {
@@ -60,7 +61,7 @@ describe('SimpleExperimentationService', () => {
6061 } ) ;
6162
6263 it ( 'should not fire onDidTreatmentsChange event when no variables change' , ( ) => {
63- const service = new SimpleExperimentationService ( false ) ;
64+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
6465 const events : string [ ] [ ] = [ ] ;
6566
6667 // Set initial value
@@ -85,7 +86,7 @@ describe('SimpleExperimentationService', () => {
8586 } ) ;
8687
8788 it ( 'should fire onDidTreatmentsChange event only for changed variables' , ( ) => {
88- const service = new SimpleExperimentationService ( false ) ;
89+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
8990
9091 // Set initial values
9192 const variables1 : Record < string , boolean | number | string > = {
@@ -113,7 +114,7 @@ describe('SimpleExperimentationService', () => {
113114 } ) ;
114115
115116 it ( 'should overwrite existing treatment variables' , ( ) => {
116- const service = new SimpleExperimentationService ( false ) ;
117+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
117118
118119 const variables1 : Record < string , boolean | number | string > = {
119120 'feature-flag' : true
@@ -133,7 +134,7 @@ describe('SimpleExperimentationService', () => {
133134 } ) ;
134135
135136 it ( 'should wait for treatment variables when waitForTreatmentVariables = true' , async ( ) => {
136- const service = new SimpleExperimentationService ( true ) ;
137+ const service = new SimpleExperimentationService ( true , new DefaultsOnlyConfigurationService ( ) ) ;
137138
138139 // hasTreatments() should not resolve until updateTreatmentVariables() is called
139140 let hasTreatmentsResolved = false ;
@@ -160,7 +161,7 @@ describe('SimpleExperimentationService', () => {
160161 } ) ;
161162
162163 it ( 'should remove treatment variable when omitted from update' , ( ) => {
163- const service = new SimpleExperimentationService ( false ) ;
164+ const service = new SimpleExperimentationService ( false , new DefaultsOnlyConfigurationService ( ) ) ;
164165
165166 // Set initial variables
166167 const variables1 : Record < string , boolean | number | string > = {
0 commit comments