Hello,
I am having a typescript - angular - systemjs project and I am using it with karma-systemjs.
I have managed for it to work in loading the files needed properly when running karma tests, but I just cannot get it to work for karma-coverage.
karma.config.js:
module.exports = function (config) {
config.set({
basePath: './',
files: [
'./Scripts/UnitTests/Tests/Controllers/**.js',
],
exclude: [],
frameworks: [
"systemjs",
"jasmine"
],
logLevel: config.LOG_DEBUG,
plugins: [
'karma-coverage',
'karma-systemjs',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-jasmine'
],
coverageReporter: {
type: 'json',
subdir: '.',
file: 'coverage-final.json'
},
reporters: ['progress', 'coverage'],
preprocessors: {
'app/**/!(*.spec).js': 'coverage'
},
browsers: ['Chrome'],
autoWatch: true,
singleRun: false,
systemjs: {
includeFiles: [
'./Scripts/Libs/angular/angular.min.js',
'./Scripts/Libs/angular-mocks/angular-mocks.js',
'./Scripts/Libs/lodash/dist/lodash.min.js'
],
serveFiles: [
'Scripts/Controllers/*.js',
],
configFile: './system.config.js',
config: {
packages: {
'app': {
defaultExtension: 'js'
}
}
},
}
});
};
system.config.js:
System.config({
baseURL: './',
defaultJSExtensions: true,
map: {
'systemjs': 'node_modules/systemjs/dist/system.js',
'system-polyfills': 'node_modules/systemjs/dist/system-polyfills.js',
'typescript': "node_modules/typescript/lib/typescript.js",
'es6-module-loader': 'node_modules/es6-module-loader/dist/es6-module-loader.js'
},
meta: {
'app/*': { format: 'register' }
},
transpiler: "typescript"
});
if i change the preprocessors with the correct folder, for example
'Scripts/Controllers/*.js': 'coverage'
I get the error DashboardController.js interpreted as global module format, but called System.register.
Error loading DashboardControllerTester.js
Any suggestions?
Hello,
I am having a typescript - angular - systemjs project and I am using it with karma-systemjs.
I have managed for it to work in loading the files needed properly when running karma tests, but I just cannot get it to work for karma-coverage.
karma.config.js:
system.config.js:
if i change the preprocessors with the correct folder, for example
'Scripts/Controllers/*.js': 'coverage'I get the error DashboardController.js interpreted as global module format, but called System.register.
Error loading DashboardControllerTester.js
Any suggestions?