diff --git a/karma.conf.js b/karma.conf.js index e2fd0b250d..cee8401576 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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 diff --git a/test-main.js b/test-main.js index c73af26887..2e67985d60 100644 --- a/test-main.js +++ b/test-main.js @@ -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