Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,554 additions
and
1,465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* taken from angular2-webpack-starter | ||
*/ | ||
var path = require('path'); | ||
|
||
// Helper functions | ||
var ROOT = path.resolve(__dirname, './'); | ||
|
||
function hasProcessFlag(flag) { | ||
return process.argv.join('').indexOf(flag) > -1; | ||
} | ||
|
||
function isWebpackDevServer() { | ||
return process.argv[1] && !! (/webpack-dev-server$/.exec(process.argv[1])); | ||
} | ||
|
||
function root(args) { | ||
args = Array.prototype.slice.call(arguments, 0); | ||
return path.join.apply(path, [ROOT].concat(args)); | ||
} | ||
|
||
function checkNodeImport(context, request, cb) { | ||
if (!path.isAbsolute(request) && request.charAt(0) !== '.') { | ||
cb(null, 'commonjs ' + request); return; | ||
} | ||
cb(); | ||
} | ||
|
||
exports.hasProcessFlag = hasProcessFlag; | ||
exports.isWebpackDevServer = isWebpackDevServer; | ||
exports.root = root; | ||
exports.checkNodeImport = checkNodeImport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,70 @@ | ||
// Karma configuration | ||
// Generated on Wed Dec 02 2015 22:57:01 GMT+0100 (Paris, Madrid) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: './', | ||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
// System.js for module loading | ||
'node_modules/systemjs/dist/system.src.js', | ||
|
||
// Polyfills | ||
'node_modules/core-js/client/shim.js', | ||
|
||
// Reflect and Zone.js | ||
'node_modules/reflect-metadata/Reflect.js', | ||
'node_modules/zone.js/dist/zone.js', | ||
'node_modules/zone.js/dist/long-stack-trace-zone.js', | ||
'node_modules/zone.js/dist/proxy.js', | ||
'node_modules/zone.js/dist/sync-test.js', | ||
'node_modules/zone.js/dist/jasmine-patch.js', | ||
'node_modules/zone.js/dist/async-test.js', | ||
'node_modules/zone.js/dist/fake-async-test.js', | ||
|
||
// RxJs. | ||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, | ||
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, | ||
|
||
// Angular 2 itself and the testing library | ||
{ pattern: 'node_modules/@angular/**/*.js', included: false, watched: false }, | ||
{ pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false }, | ||
|
||
'karma-test-shim.js', | ||
|
||
{ pattern: '*.ts', included: false, watched: true }, | ||
{ pattern: 'src/**/*.ts', included: false, watched: true }, | ||
], | ||
|
||
// list of files to exclude | ||
exclude: [ | ||
'src/**/*.d.ts' | ||
], | ||
|
||
preprocessors: { | ||
'**/*.ts': ['typescript'] | ||
}, | ||
|
||
typescriptPreprocessor: { | ||
options: require('./tsconfig.json').compilerOptions, | ||
}, | ||
|
||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false, | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: process.env.TRAVIS ? ['Chrome_travis_ci'] : ['Chrome'], | ||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultanous | ||
concurrency: Infinity | ||
}); | ||
}; | ||
var testWebpackConfig = require('./webpack.test.js'); | ||
|
||
var configuration = { | ||
basePath: '', | ||
|
||
frameworks: ['jasmine'], | ||
|
||
// list of files to exclude | ||
exclude: [ ], | ||
|
||
/* | ||
* list of files / patterns to load in the browser | ||
* | ||
* we are building the test environment in ./spec-bundle.js | ||
*/ | ||
files: [ { pattern: './spec-bundle.js', watched: false } ], | ||
|
||
preprocessors: { './spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] }, | ||
|
||
// Webpack Config at ./webpack.test.js | ||
webpack: testWebpackConfig, | ||
|
||
coverageReporter: { | ||
dir : 'coverage/', | ||
reporters: [ | ||
{ type: 'text-summary' }, | ||
{ type: 'json' }, | ||
{ type: 'html' } | ||
] | ||
}, | ||
|
||
// Webpack please don't spam the console when running in karma! | ||
webpackServer: { noInfo: true }, | ||
|
||
reporters: [ 'mocha', 'coverage' ], | ||
|
||
// web server port | ||
port: 9876, | ||
|
||
colors: true, | ||
|
||
/* | ||
* level of logging | ||
* possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
*/ | ||
logLevel: config.LOG_INFO, | ||
|
||
autoWatch: false, | ||
|
||
browsers: [ | ||
'Chrome' | ||
], | ||
|
||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
|
||
singleRun: true | ||
}; | ||
|
||
if(process.env.TRAVIS){ | ||
configuration.browsers = ['Chrome_travis_ci']; | ||
} | ||
|
||
config.set(configuration); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.