configuration translate and core karma RC1

This commit is contained in:
Eugenio Romano
2016-06-14 19:23:33 +01:00
parent 94d004aee7
commit ebd1e0abac
8 changed files with 83 additions and 65 deletions

View File

@@ -8,12 +8,14 @@ __karma__.loaded = function() {};
var map = {
'app': 'base/dist',
'rxjs': 'base/node_modules/rxjs',
'@angular': 'base/node_modules/@angular'
'@angular': 'base/node_modules/@angular',
'ng2-alfresco-core/dist': '/base/node_modules/ng2-alfresco-core/dist'
};
var packages = {
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' }
'rxjs': { defaultExtension: 'js' },
'ng2-alfresco-core/dist': { defaultExtension: 'js' }
};
var packageNames = [
@@ -26,7 +28,7 @@ var packageNames = [
'@angular/router',
'@angular/router-deprecated',
'@angular/testing',
'@angular/upgrade',
'@angular/upgrade'
];
packageNames.forEach(function(pkgName) {
@@ -54,7 +56,7 @@ System.import('@angular/platform-browser/src/browser/browser_adapter')
__karma__.start();
},
function(error) {
if(typeof __karma__.error == 'fucntion') {
if(typeof __karma__.error == 'function') {
__karma__.error(error.stack || error);
}else{
console.error(error);

View File

@@ -4,16 +4,18 @@ module.exports = function (config) {
var configuration = {
basePath: '.',
frameworks: ['jasmine'],
frameworks: ['jasmine-ajax', 'jasmine'],
files: [
// paths loaded by Karma
{pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: true},
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: true},
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false, served: true},
{pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, watched: true},
{pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: true},
{pattern: 'node_modules/angular2/bundles/http.dev.js', included: true, watched: true},
{pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: true},
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: true},
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
{pattern: 'node_modules/rxjs/**/*.map', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.map', included: false, watched: false},
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
{pattern: 'karma-test-shim.js', included: true, watched: true},
@@ -37,7 +39,7 @@ module.exports = function (config) {
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
logLevel: config.LOG_DEBUG,
colors: true,
@@ -45,7 +47,6 @@ module.exports = function (config) {
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
@@ -57,6 +58,7 @@ module.exports = function (config) {
plugins: [
'karma-jasmine',
'karma-coverage',
'karma-jasmine-ajax',
'karma-chrome-launcher',
'karma-mocha-reporter',
'karma-jasmine-html-reporter'
@@ -76,16 +78,15 @@ module.exports = function (config) {
subdir: 'report',
reporters: [
{type: 'text'},
{type: 'text-summary'},
{type: 'json', file: 'coverage-final.json'},
{type: 'html'}
]
}
}
if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}
config.set(configuration)
};