Skip to content

Commit b2a24e4

Browse files
committed
added debug argument to (node:23405) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
�[2K�[1G�[?25h�[2K�[1G�[?25hYou have to be inside an angular-cli project in order to use the test command.. This argument when passed disable instrumentation and coverage, allowing to debug the source code when running tests
1 parent 2b7f8c4 commit b2a24e4

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

addon/ng2/blueprints/ng2/files/config/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = function (config) {
3131
}
3232
},
3333
angularCliConfig: './angular-cli.json',
34-
reporters: ['progress', 'karma-remap-istanbul'],
34+
reporters: config.debug ? ['progress'] : ['progress', 'karma-remap-istanbul'],
3535
port: 9876,
3636
colors: true,
3737
logLevel: config.LOG_INFO,

addon/ng2/commands/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as TestTask from '../tasks/test';
55
module.exports = TestCommand.extend({
66
availableOptions: [
77
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
8+
{ name: 'debug', type: Boolean, default: false, aliases: ['d'] },
89
{ name: 'browsers', type: String },
910
{ name: 'colors', type: Boolean },
1011
{ name: 'log-level', type: String },

addon/ng2/models/webpack-build-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const path = require('path');
44
const webpack = require('webpack');
55

6-
const getWebpackTestConfig = function(projectRoot, appConfig) {
7-
6+
const getWebpackTestConfig = function(projectRoot, appConfig, debug=false) {
7+
88
const appRoot = path.resolve(projectRoot, appConfig.root);
99

1010
return {
@@ -66,7 +66,7 @@ const getWebpackTestConfig = function(projectRoot, appConfig) {
6666
{ test: /\.(jpg|png)$/, loader: 'url-loader?limit=128000' },
6767
{ test: /\.html$/, loader: 'raw-loader', exclude: [path.resolve(appRoot, appConfig.index)] }
6868
],
69-
postLoaders: [
69+
postLoaders: debug ? [] : [
7070
{
7171
test: /\.(js|ts)$/, loader: 'sourcemap-istanbul-instrumenter-loader',
7272
exclude: [

plugins/karma.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const init = (config) => {
99
const appConfig = angularCliConfig.apps[0];
1010

1111
// add webpack config
12-
config.webpack = getWebpackTestConfig(config.basePath, appConfig);
12+
config.webpack = getWebpackTestConfig(config.basePath, appConfig, config.debug);
1313
config.webpackMiddleware = {
1414
noInfo: true, // Hide webpack output because its noisy.
1515
stats: { // Also prevent chunk and module display output, cleaner look. Only emit errors.

0 commit comments

Comments
 (0)