forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaaTesting.unit.test.ts
More file actions
31 lines (27 loc) · 1.14 KB
/
aaTesting.unit.test.ts
File metadata and controls
31 lines (27 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import * as TypeMoq from 'typemoq';
import { AATesting } from '../../client/activation/aaTesting';
import { ValidateABTesting } from '../../client/common/experiments/groups';
import { IExperimentsManager } from '../../client/common/types';
suite('A/A Testing', () => {
let experiments: TypeMoq.IMock<IExperimentsManager>;
let aaTesting: AATesting;
setup(() => {
experiments = TypeMoq.Mock.ofType<IExperimentsManager>();
aaTesting = new AATesting(experiments.object);
});
test('Send telemetry corresponding to the experiment user is in', async () => {
experiments
.setup((exp) => exp.sendTelemetryIfInExperiment(ValidateABTesting.experiment))
.returns(() => undefined)
.verifiable(TypeMoq.Times.once());
experiments
.setup((exp) => exp.sendTelemetryIfInExperiment(ValidateABTesting.control))
.returns(() => undefined)
.verifiable(TypeMoq.Times.once());
await aaTesting.activate();
experiments.verifyAll();
});
});