From 0164fd190f8feed4dc6cb84d86ab7b6848a3234e Mon Sep 17 00:00:00 2001 From: Dana Gutride Date: Thu, 23 Mar 2017 14:35:04 -0400 Subject: [PATCH] fix(tests): modify test configuration for speed --- config/webpack.test.js | 37 ++++++++++++++++------------ tsconfig-test.json | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 tsconfig-test.json diff --git a/config/webpack.test.js b/config/webpack.test.js index d90c6ed..cc399e6 100644 --- a/config/webpack.test.js +++ b/config/webpack.test.js @@ -55,17 +55,14 @@ sassModules.forEach(function (val) { module.exports = function (options) { return { - entry: { - 'app': './src/main.browser.ts' - }, - /** * Source map for Karma from the help of karma-sourcemap-loader & karma-webpack * * Do not change, leave as is or it wont work. * See: https://github.com/webpack/karma-webpack#source-maps */ - devtool: 'inline-source-map', + // remove for speed - can enable when debugging or running in a browser + //devtool: 'inline-source-map', /** * Options affecting the resolving of modules. @@ -105,15 +102,16 @@ module.exports = function (options) { * * See: https://github.com/webpack/source-map-loader */ - { - test: /\.js$/, - use: ['source-map-loader'], - exclude: [ - // these packages have problems with their sourcemaps - path.resolve(__dirname, 'node_modules/rxjs'), - path.resolve(__dirname, 'node_modules/@angular') - ] - }, + // js sourcemaps disabled for performance, can be enabled for debugging + // { + // test: /\.js$/, + // use: ['source-map-loader'], + // exclude: [ + // // these packages have problems with their sourcemaps + // path.resolve(__dirname, 'node_modules/rxjs'), + // path.resolve(__dirname, 'node_modules/@angular') + // ] + // }, /** * Typescript loader support for .ts and Angular 2 async routes via .async.ts @@ -123,8 +121,15 @@ module.exports = function (options) { { test: /\.ts$/, use: [ - 'awesome-typescript-loader', - 'angular2-template-loader' + { + loader: "awesome-typescript-loader", + options: { + configFileName: 'tsconfig-test.json' + } + }, + { + loader: "angular2-template-loader" + } ], exclude: [/\.e2e\.ts$/] }, diff --git a/tsconfig-test.json b/tsconfig-test.json new file mode 100644 index 0000000..9abde1d --- /dev/null +++ b/tsconfig-test.json @@ -0,0 +1,56 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "es2015", + "moduleResolution": "node", + "declaration": true, + "stripInternal": true, + "skipLibCheck": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "sourceMap": false, + "inlineSources": false, + "noEmitHelpers": false, + "strictNullChecks": false, + "removeComments": false, + "noImplicitAny": false, + "allowUnreachableCode": false, + "baseUrl": ".", + "rootDir": ".", + "outDir": "dist", + "noEmit": true, + "paths": { + "@angular/common": ["node_modules/@angular/common"], + "@angular/forms": ["node_modules/@angular/forms"], + "rxjs/*": ["node_modules/rxjs/*"] + }, + "lib": [ + "es2015", + "dom" + ] + }, + "files": [ + "index.ts" + ], + "exclude": [ + "node_modules", + "**/*.spec.ts", + "dist" + ], + "awesomeTypescriptLoaderOptions": { + "forkChecker": true, + "useWebpackText": true, + "useCache": true + }, + "angularCompilerOptions": { + "strictMetadataEmit": true, + "skipTemplateCodegen": true, + "genDir": "./ngfactory" + }, + "compileOnSave": false, + "buildOnSave": false, + "atom": { "rewriteTsconfig": false } +} + +