Skip to content

Commit 5830040

Browse files
committed
fix (test command): generate source maps when debug-brk is set
1 parent f031e8d commit 5830040

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Diff for: lib/services/test-execution-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class TestExecutionService implements ITestExecutionService {
125125
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);
126126
};
127127

128-
karmaRunner.on("message", (karmaData: any) => {
128+
karmaRunner.on("message", (karmaData: any) => {
129129
this.$logger.trace(`The received message from karma is: `, karmaData);
130130
if (!karmaData.launcherConfig && !karmaData.url) {
131131
return;
@@ -219,6 +219,7 @@ export class TestExecutionService implements ITestExecutionService {
219219

220220
karmaConfig.projectDir = projectData.projectDir;
221221
karmaConfig.bundle = this.$options.bundle;
222+
karmaConfig.debugBrk = this.$options.debugBrk;
222223
karmaConfig.platform = platform.toLowerCase();
223224
this.$logger.debug(JSON.stringify(karmaConfig, null, 4));
224225

Diff for: resources/test/karma.conf.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(config) {
1+
module.exports = function (config) {
22
const options = {
33

44
// base path that will be used to resolve all patterns (eg. files, exclude)
@@ -11,7 +11,7 @@ module.exports = function(config) {
1111

1212

1313
// list of files / patterns to load in the browser
14-
files: [ ${ testFiles } ],
14+
files: [${ testFiles }],
1515

1616

1717
// list of files to exclude
@@ -75,7 +75,7 @@ module.exports = function(config) {
7575

7676
setWebpackPreprocessor(config, options);
7777
setWebpack(config, options);
78-
78+
7979
config.set(options);
8080
}
8181

@@ -87,7 +87,7 @@ function setWebpackPreprocessor(config, options) {
8787

8888
options.files.forEach(file => {
8989
if (!options.preprocessors[file]) {
90-
options.preprocessors[file] = [];
90+
options.preprocessors[file] = []
9191
}
9292
options.preprocessors[file].push('webpack');
9393
});
@@ -98,6 +98,7 @@ function setWebpack(config, options) {
9898
if (config && config.bundle) {
9999
const env = {};
100100
env[config.platform] = true;
101+
env.sourceMap = config.debugBrk;
101102
options.webpack = require('./webpack.config')(env);
102103
delete options.webpack.entry;
103104
delete options.webpack.output.libraryTarget;

0 commit comments

Comments
 (0)