Skip to content

Commit d757116

Browse files
committed
debugger support
1 parent 3e131bc commit d757116

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

main-view-model.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import stopProcess = require('./stop-process');
1212
interface IHostConfiguration {
1313
port: number;
1414
ips: string[];
15-
debug: boolean;
15+
options: {
16+
debugBrk?: boolean;
17+
debugTransport?: boolean;
18+
}
1619
}
1720

1821
interface INetworkConfiguration extends IHostConfiguration {
@@ -40,6 +43,7 @@ function enableSocketIoDebugging() {
4043
}
4144

4245
var config: INetworkConfiguration = require('./config');
46+
config.options = config.options || {}
4347

4448
export class TestBrokerViewModel extends observable.Observable {
4549
private startEmitted: boolean;
@@ -68,7 +72,7 @@ export class TestBrokerViewModel extends observable.Observable {
6872

6973
global.__karma__ = this;
7074

71-
if (config.debug) {
75+
if (config.options.debugTransport) {
7276
enableSocketIoDebugging();
7377
}
7478
//debugger;
@@ -263,6 +267,11 @@ export class TestBrokerViewModel extends observable.Observable {
263267
});
264268
if (!this.hasError) {
265269
console.log('NSUTR: beginning test run');
270+
if (config.options.debugBrk) {
271+
/// HINT: If you need to place breakpoints in your tests, navigate to your test files in the Sources panel.
272+
/// Hit the 'Resume script execution' button or F8 to continue to your tests.
273+
debugger;
274+
}
266275
this.start(this.config);
267276
}
268277
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-unit-test-runner",
3-
"version": "0.2.4",
3+
"version": "0.2.6",
44
"description": "NativeScript unit test runner component.",
55
"main": "app.js",
66
"scripts": {

0 commit comments

Comments
 (0)