@@ -12,6 +12,7 @@ import { ApplicationEnvironment } from '../../../client/common/application/appli
12
12
import { IApplicationEnvironment , IWorkspaceService } from '../../../client/common/application/types' ;
13
13
import { WorkspaceService } from '../../../client/common/application/workspace' ;
14
14
import { Channel } from '../../../client/common/constants' ;
15
+ import { DiscoveryVariants } from '../../../client/common/experiments/groups' ;
15
16
import { ExperimentService } from '../../../client/common/experiments/service' ;
16
17
import { Experiments } from '../../../client/common/utils/localize' ;
17
18
import * as Telemetry from '../../../client/telemetry' ;
@@ -157,14 +158,14 @@ suite('Experimentation service', () => {
157
158
158
159
suite ( 'In-experiment-sync check' , ( ) => {
159
160
const experiment = 'Test Experiment - experiment' ;
160
- let telemetryEvents : { eventName : string ; properties : Record < string , unknown > } [ ] = [ ] ;
161
+ let telemetryEvents : { eventName : string ; properties : unknown } [ ] = [ ] ;
161
162
let getTreatmentVariable : sinon . SinonStub ;
162
163
let sendTelemetryEventStub : sinon . SinonStub ;
163
164
164
165
setup ( ( ) => {
165
166
sendTelemetryEventStub = sinon
166
167
. stub ( Telemetry , 'sendTelemetryEvent' )
167
- . callsFake ( ( eventName : string , _ , properties : Record < string , unknown > ) => {
168
+ . callsFake ( ( eventName : string , _ , properties : unknown ) => {
168
169
const telemetry = { eventName, properties } ;
169
170
telemetryEvents . push ( telemetry ) ;
170
171
} ) ;
@@ -182,6 +183,20 @@ suite('Experimentation service', () => {
182
183
sinon . restore ( ) ;
183
184
} ) ;
184
185
186
+ test ( 'Enable discovery experiment without file watching for all users' , async ( ) => {
187
+ configureSettings ( true , [ ] , [ ] ) ;
188
+
189
+ const experimentService = new ExperimentService (
190
+ instance ( workspaceService ) ,
191
+ instance ( appEnvironment ) ,
192
+ globalMemento ,
193
+ outputChannel ,
194
+ ) ;
195
+ const result = experimentService . inExperimentSync ( DiscoveryVariants . discoveryWithoutFileWatching ) ;
196
+
197
+ assert . isTrue ( result ) ;
198
+ } ) ;
199
+
185
200
test ( 'If the opt-in and opt-out arrays are empty, return the value from the experimentation framework for a given experiment' , async ( ) => {
186
201
configureSettings ( true , [ ] , [ ] ) ;
187
202
@@ -401,13 +416,13 @@ suite('Experimentation service', () => {
401
416
} ) ;
402
417
403
418
suite ( 'Opt-in/out telemetry' , ( ) => {
404
- let telemetryEvents : { eventName : string ; properties : Record < string , unknown > } [ ] = [ ] ;
419
+ let telemetryEvents : { eventName : string ; properties : unknown } [ ] = [ ] ;
405
420
let sendTelemetryEventStub : sinon . SinonStub ;
406
421
407
422
setup ( ( ) => {
408
423
sendTelemetryEventStub = sinon
409
424
. stub ( Telemetry , 'sendTelemetryEvent' )
410
- . callsFake ( ( eventName : string , _ , properties : Record < string , unknown > ) => {
425
+ . callsFake ( ( eventName : string , _ , properties : unknown ) => {
411
426
const telemetry = { eventName, properties } ;
412
427
telemetryEvents . push ( telemetry ) ;
413
428
} ) ;
0 commit comments