-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathtest.ts
31 lines (27 loc) · 1.55 KB
/
test.ts
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
import * as helpers from "../common/helpers";
function RunTestCommandFactory(platform: string) {
return function RunTestCommand(
$options: IOptions,
$testExecutionService: ITestExecutionService,
$projectData: IProjectData,
$analyticsService: IAnalyticsService) {
$projectData.initializeProjectData();
$analyticsService.setShouldDispose($options.justlaunch || !$options.watch);
const projectFilesConfig = helpers.getProjectFilesConfig({ isReleaseBuild: $options.release });
this.execute = (args: string[]): Promise<void> => $testExecutionService.startTestRunner(platform, $projectData, projectFilesConfig);
this.allowedParameters = [];
};
}
$injector.registerCommand("dev-test|android", RunTestCommandFactory('android'));
$injector.registerCommand("dev-test|ios", RunTestCommandFactory('iOS'));
function RunKarmaTestCommandFactory(platform: string) {
return function RunKarmaTestCommand($options: IOptions, $testExecutionService: ITestExecutionService, $projectData: IProjectData, $analyticsService: IAnalyticsService) {
$projectData.initializeProjectData();
$analyticsService.setShouldDispose($options.justlaunch || !$options.watch);
const projectFilesConfig = helpers.getProjectFilesConfig({ isReleaseBuild: $options.release });
this.execute = (args: string[]): Promise<void> => $testExecutionService.startKarmaServer(platform, $projectData, projectFilesConfig);
this.allowedParameters = [];
};
}
$injector.registerCommand("test|android", RunKarmaTestCommandFactory('android'));
$injector.registerCommand("test|ios", RunKarmaTestCommandFactory('iOS'));