Skip to content

Commit 3b5762e

Browse files
Make sure all dependencies are installed before starting karma
In case node_modules dir is deleted, `tns test <platform>` command will fail. So ensure all dependencies are installed before starting karma server.
1 parent fb15791 commit 3b5762e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/services/test-execution-service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class TestExecutionService implements ITestExecutionService {
3232
private $config: IConfiguration,
3333
private $logger: ILogger,
3434
private $fs: IFileSystem,
35-
private $options: IOptions) {
35+
private $options: IOptions,
36+
private $pluginsService: IPluginsService) {
3637
}
3738

3839
public startTestRunner(platform: string) : IFuture<void> {
@@ -133,6 +134,7 @@ class TestExecutionService implements ITestExecutionService {
133134
public startKarmaServer(platform: string): IFuture<void> {
134135
return (() => {
135136
platform = platform.toLowerCase();
137+
this.$pluginsService.ensureAllDependenciesAreInstalled().wait();
136138
let pathToKarma = path.join(this.$projectData.projectDir, 'node_modules/karma');
137139
let KarmaServer = require(path.join(pathToKarma, 'lib/server'));
138140
if (platform === 'ios' && this.$options.emulator) {

0 commit comments

Comments
 (0)