diff --git a/build/tasks/test.js b/build/tasks/test.js index 4f9896de..18d396f3 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -5,7 +5,7 @@ var Server = require('karma').Server; /** * Run test once and exit */ -gulp.task('test', function (done) { +gulp.task('test', ['inlineTemplates'], function (done) { new Server({ configFile: __dirname + '/../../karma.conf.js', singleRun: true diff --git a/karma.conf.js b/karma.conf.js index 1b016aec..d2564bad 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,13 @@ module.exports = function (config) { config.set({ frameworks: ['phantomjs-shim', 'jspm', 'jasmine', 'sinon', 'should'], preprocessors: { - 'lib/**/!(*spec).js': ['babel', 'coverage'] + 'lib/**/!(*spec).js': ['babel', 'regex', 'coverage'] + }, + + regexPreprocessor: { + rules: [ + [ /'\.(.*?)\.css'/g, '\'.tmp$1.css\''] + ] }, babelPreprocessor: { options: { @@ -47,7 +53,7 @@ module.exports = function (config) { jspm: { config: 'system.config.js', loadFiles: ['tests/**/*.spec.js', 'tests/helpers.js', 'lib/**/*.js'], - serveFiles: ['tests/schemas/**/*.json', 'lib/**/*.{html,css}'], + serveFiles: ['tests/schemas/**/*.json', 'lib/**/*.html', '.tmp/lib/**/*.css'], nocache: true }, @@ -56,6 +62,7 @@ module.exports = function (config) { '/lib/': '/base/lib/', '/jspm_packages/': '/base/jspm_packages/', '/node_modules/': '/base/node_modules/', + '/.tmp/': '/base/.tmp/' }, reporters: travis ? ['mocha', 'coverage', 'coveralls'] : ['mocha', 'coverage'], diff --git a/package.json b/package.json index 8435f4d6..fce31c6d 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "karma-mocha-reporter": "^1.1.3", "karma-phantomjs-launcher": "^0.2.1", "karma-phantomjs-shim": "^1.1.2", + "karma-regex-preprocessor": "github:makern/karma-regex-preprocessor", "karma-should": "^1.0.0", "karma-sinon": "^1.0.4", "phantomjs": "^1.9.19", @@ -89,6 +90,5 @@ "systemjs-builder": "^0.14.7", "vinyl-paths": "^2.0.0", "zone.js": "^0.5.8" - }, - "dependencies": {} + } }