[Build] Update test runner

This commit is contained in:
Victor Woeltjen 2016-01-29 10:26:47 -08:00
parent 0a546cd50c
commit e564baba1a
2 changed files with 26 additions and 5 deletions

View File

@ -34,6 +34,7 @@ module.exports = function(config) {
// List of files / patterns to load in the browser.
// By default, files are also included in a script tag.
files: [
{pattern: 'bower_components/**/*.js', included: false},
{pattern: 'src/**/*.js', included: false},
{pattern: 'example/**/*.js', included: false},
{pattern: 'platform/**/*.js', included: false},
@ -49,7 +50,8 @@ module.exports = function(config) {
// Preprocess matching files before serving them to the browser.
// https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'**/src/**/!(*Spec).js': [ 'coverage' ]
'src/**/src/**/!(*Spec).js': [ 'coverage' ],
'platform/**/src/**/!(*Spec).js': [ 'coverage' ]
},
// Test results reporter to use

View File

@ -38,13 +38,32 @@ Object.keys(window.__karma__.files).forEach(function(file) {
// Force es6-promise to load.
allTestFiles.unshift('es6-promise');
require.config({
requirejs.config({
// Karma serves files from the basePath defined in karma.conf.js
baseUrl: '/base',
paths: {
'es6-promise': 'platform/framework/lib/es6-promise-2.0.0.min',
'moment': 'platform/telemetry/lib/moment.min'
"paths": {
"legacyRegistry": "src/legacyRegistry",
"angular": "bower_components/angular/angular.min",
"angular-route": "bower_components/angular-route/angular-route.min",
"es6-promise": "bower_components/es6-promise/promise.min",
"moment": "bower_components/moment/moment",
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
"screenfull": "bower_components/screenfull/dist/screenfull.min",
"text": "bower_components/text/text",
"uuid": "bower_components/node-uuid/uuid"
},
"shim": {
"angular": {
"exports": "angular"
},
"angular-route": {
"deps": [ "angular" ]
},
"moment-duration-format": {
"deps": [ "moment" ]
}
},
// dynamically load all test files