Skip to content

Fix hanging commands when webpack and unit tests are used #3212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ function RunTestCommandFactory(platform: string) {
return function RunTestCommand(
$options: IOptions,
$testExecutionService: ITestExecutionService,
$projectData: IProjectData) {
$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 = [];
Expand All @@ -16,8 +18,9 @@ $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) {
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 = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/common
2 changes: 0 additions & 2 deletions lib/services/test-execution-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class TestExecutionService implements ITestExecutionService {
private $errors: IErrors,
private $debugService: IDebugService,
private $devicesService: Mobile.IDevicesService,
private $analyticsService: IAnalyticsService,
private $childProcess: IChildProcess) {
this.$analyticsService.setShouldDispose(this.$options.justlaunch || !this.$options.watch);
}

public platform: string;
Expand Down