Skip to content

Commit 71d762b

Browse files
Merge pull request #23 from NativeScript/vladimirov/fix-unit-test-runner
Change the way karma communicate with CLI
2 parents f79894b + cf81ef8 commit 71d762b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ function NativeScriptLauncher(baseBrowserDecorator, logger, config, args, emitte
3131

3232
var launcherConfig = config._NS || {};
3333

34-
emitter.on('file_list_modified', function() {
35-
self.log.info('Deploying NativeScript unit tests...');
36-
if (self.parsedUrl) {
37-
self.liveSyncAndRun(self.parsedUrl);
38-
}
39-
})
40-
4134
emitter.on('browser_register', function(browser) {
4235
if (!browser.id || browser.id.indexOf('NativeScript') !== 0) {
4336
return;
@@ -52,6 +45,7 @@ function NativeScriptLauncher(baseBrowserDecorator, logger, config, args, emitte
5245
process.stdout.write(data);
5346
}
5447

48+
// Consider removing this in case we drop support for `tns dev-test` command
5549
self.liveSyncAndRun = function() {
5650
var tnsArgs = ['dev-test', self.platform, '--port', self.parsedUrl.port];
5751
if (args.arguments) {
@@ -91,7 +85,7 @@ function NativeScriptLauncher(baseBrowserDecorator, logger, config, args, emitte
9185

9286
self.start = function(url) {
9387
self.parsedUrl = URL.parse(url);
94-
self.liveSyncAndRun();
88+
process.send({ url: self.parsedUrl, launcherConfig: JSON.stringify(launcherConfig.options) });
9589
}
9690
}
9791

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "karma-nativescript-launcher",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)