Skip to content

Commit 8ccc7d2

Browse files
committed
chore(test) Added a crapton of node-modules for the entire testing suite.
1 parent 2882ce6 commit 8ccc7d2

File tree

4 files changed

+143
-3
lines changed

4 files changed

+143
-3
lines changed

addon/ng2/models/save-for-later.ts

+24
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,27 @@
2222
// configFileName: ngAppResolve('./src/tsconfig.json'),
2323
// silent: true
2424
// },
25+
// output: {
26+
// path: './dist/',
27+
// filename: '[name].[chunkhash].js',
28+
// sourceMapFilename: '[name].[chunkhash].map',
29+
// chunkFilename: '[chunkhash].js'
30+
// },
31+
// recordsPath: path.join(__dirname, "records.json"),
32+
//
33+
//
34+
//
35+
//
36+
// new webpack.optimize.CommonsChunkPlugin({
37+
// names: ['main', 'vendors', 'polyfills']
38+
// }),
39+
// new webpack.optimize.CommonsChunkPlugin({
40+
// minChunks: Infinity,
41+
// name: 'inline',
42+
// filename: 'inline.js',
43+
// sourceMapFilename: 'inline.map'
44+
// }),
45+
// new HtmlWebpackPlugin({
46+
// template:'./src/index.html',
47+
// chunksSortMode: "dependency"
48+
// })

addon/ng2/models/webpack-build-config.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export const webpackCommonConfig = {
5959
path: ngAppResolve('./dist'),
6060
filename: '[name].bundle.js'
6161
},
62-
6362
module: {
6463
loaders: [
6564
{
@@ -79,9 +78,9 @@ export const webpackCommonConfig = {
7978
useWebpackText: true,
8079
tsconfig: ngAppResolve('./src/tsconfig.json'),
8180
resolveGlobs: false,
82-
module: "es6",
81+
module: "es2015",
8382
target: "es5",
84-
lib: ["es6", "dom"]
83+
lib: ["es2015", "dom"]
8584
}
8685
},
8786
{
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/**
2+
* @author: @AngularClass
3+
*/
4+
5+
module.exports = function(config) {
6+
var testWebpackConfig = require('./webpack.test.js');
7+
8+
config.set({
9+
10+
// base path that will be used to resolve all patterns (e.g. files, exclude)
11+
basePath: '',
12+
13+
/*
14+
* Frameworks to use
15+
*
16+
* available frameworks: https://npmjs.org/browse/keyword/karma-adapter
17+
*/
18+
frameworks: ['jasmine'],
19+
20+
// list of files to exclude
21+
exclude: [ ],
22+
23+
/*
24+
* list of files / patterns to load in the browser
25+
*
26+
* we are building the test environment in ./spec-bundle.js
27+
*/
28+
files: [ { pattern: './config/spec-bundle.js', watched: false } ],
29+
30+
/*
31+
* preprocess matching files before serving them to the browser
32+
* available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
33+
*/
34+
preprocessors: { './config/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] },
35+
36+
// Webpack Config at ./webpack.test.js
37+
webpack: testWebpackConfig,
38+
39+
coverageReporter: {
40+
dir : 'coverage/',
41+
reporters: [
42+
{ type: 'text-summary' },
43+
{ type: 'json' },
44+
{ type: 'html' }
45+
]
46+
},
47+
48+
// Webpack please don't spam the console when running in karma!
49+
webpackServer: { noInfo: true },
50+
51+
/*
52+
* test results reporter to use
53+
*
54+
* possible values: 'dots', 'progress'
55+
* available reporters: https://npmjs.org/browse/keyword/karma-reporter
56+
*/
57+
reporters: [ 'mocha', 'coverage' ],
58+
59+
// web server port
60+
port: 9876,
61+
62+
// enable / disable colors in the output (reporters and logs)
63+
colors: true,
64+
65+
/*
66+
* level of logging
67+
* possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
68+
*/
69+
logLevel: config.LOG_INFO,
70+
71+
// enable / disable watching file and executing tests whenever any file changes
72+
autoWatch: false,
73+
74+
/*
75+
* start these browsers
76+
* available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
77+
*/
78+
browsers: [
79+
// 'Chrome',
80+
'PhantomJS'
81+
],
82+
83+
/*
84+
* Continuous Integration mode
85+
* if true, Karma captures browsers, runs the tests and exits
86+
*/
87+
singleRun: true
88+
});
89+
90+
};

package.json

+27
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,56 @@
3636
"babel-loader": "^6.2.4",
3737
"babel-preset-es2015-webpack": "^6.4.1",
3838
"chalk": "^1.1.3",
39+
"copy-webpack-plugin": "^3.0.1",
3940
"core-js": "^2.4.0",
41+
"css-loader": "^0.23.1",
4042
"ember-cli": "2.5.0",
4143
"ember-cli-string-utils": "^1.0.0",
4244
"exit": "^0.1.2",
45+
"exports-loader": "^0.6.3",
46+
"expose-loader": "^0.7.1",
47+
"file-loader": "^0.8.5",
4348
"fs-extra": "^0.30.0",
4449
"glob": "^7.0.3",
4550
"handlebars": "^4.0.5",
4651
"html-webpack-plugin": "^2.19.0",
52+
"http-server": "^0.9.0",
4753
"json-loader": "^0.5.4",
54+
"karma": "^0.13.22",
55+
"karma-chrome-launcher": "^1.0.1",
56+
"karma-coverage": "^1.0.0",
57+
"karma-jasmine": "^1.0.2",
58+
"karma-mocha-reporter": "^2.0.4",
59+
"karma-phantomjs-launcher": "^1.0.0",
60+
"karma-sourcemap-loader": "^0.3.7",
61+
"karma-webpack": "^1.7.0",
4862
"leek": "0.0.21",
4963
"lodash": "^4.11.1",
5064
"opn": "4.0.1",
65+
"parse5": "^2.1.5",
66+
"phantomjs-polyfill": "0.0.2",
67+
"phantomjs-prebuilt": "^2.1.7",
68+
"postcss-loader": "^0.9.1",
69+
"protractor": "^3.3.0",
5170
"raw-loader": "^0.5.1",
71+
"remap-istanbul": "^0.6.4",
5272
"resolve": "^1.1.7",
73+
"rimraf": "^2.5.2",
74+
"sass-loader": "^3.2.0",
5375
"shelljs": "^0.7.0",
5476
"silent-error": "^1.0.0",
5577
"style-loader": "^0.13.1",
78+
"stylus-loader": "^2.1.0",
5679
"symlink-or-copy": "^1.0.3",
5780
"systemjs-builder": "0.15.17",
5881
"ts-helpers": "^1.1.1",
5982
"ts-loader": "^0.8.2",
83+
"tslint": "^3.11.0",
84+
"tslint-loader": "^2.1.4",
85+
"typedoc": "^0.4.2",
6086
"typescript": "^1.9.0-dev.20160613-1.0",
6187
"typings": "^0.8.1",
88+
"url-loader": "^0.5.7",
6289
"webpack": "2.1.0-beta.13",
6390
"webpack-closure-compiler": "^2.0.2",
6491
"webpack-dev-server": "^1.14.1"

0 commit comments

Comments
 (0)