From f835213a9b72838b0a454b41f7052277818e978f Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Sat, 9 May 2015 08:19:38 +0200 Subject: [PATCH] feat(test): serve lib/ files instead of dist/ relates to #98 --- karma-browserify.conf.js | 4 ++-- karma-microtasks.conf.js | 11 ++++++++--- karma.conf.js | 11 ++++++++--- test/setup-microtask.js | 2 ++ test/setup.js | 2 ++ 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 test/setup-microtask.js create mode 100644 test/setup.js diff --git a/karma-browserify.conf.js b/karma-browserify.conf.js index 7a1038b2e..9b6e3faef 100644 --- a/karma-browserify.conf.js +++ b/karma-browserify.conf.js @@ -5,9 +5,9 @@ module.exports = function (config) { basePath: '', files: [ 'test/util.js', - {pattern: 'lib/zone.js', watched: true, served: false, included: false}, 'test/commonjs.spec.js', - {pattern: 'test/assets/**/*.html', watched: true, served: true, included: false} + {pattern: 'test/assets/**/*.html', watched: true, served: true, included: false}, + {pattern: 'lib/**/*.js', watched: true, served: false, included: false} ], reporters: ['progress'], diff --git a/karma-microtasks.conf.js b/karma-microtasks.conf.js index 9df909c2f..8da60f5ab 100644 --- a/karma-microtasks.conf.js +++ b/karma-microtasks.conf.js @@ -5,13 +5,18 @@ module.exports = function (config) { basePath: '', files: [ 'test/util.js', - 'dist/zone-microtask.js', + 'test/setup-microtask.js', 'dist/*-zone.js', 'test/jasmine-patch.js', 'test/microtasks.spec.js', - {pattern: 'test/assets/**/*.html', watched: true, served: true, included: false} + {pattern: 'test/assets/**/*.html', watched: true, served: true, included: false}, + {pattern: 'lib/**/*.js', watched: true, served: false, included: false} ], + preprocessors: { + 'test/setup-microtask.js': [ 'browserify' ] + }, + reporters: ['progress'], //port: 9876, @@ -20,7 +25,7 @@ module.exports = function (config) { logLevel: config.LOG_INFO, browsers: ['Firefox'], - frameworks: ['jasmine'], + frameworks: ['jasmine', 'browserify'], captureTimeout: 60000, diff --git a/karma.conf.js b/karma.conf.js index bfacd06be..ad2b25a89 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -5,14 +5,19 @@ module.exports = function (config) { basePath: '', files: [ 'test/util.js', - 'dist/zone.js', + 'test/setup.js', 'dist/*-zone.js', 'test/jasmine-patch.js', //'test/lib/brick.js', 'test/**/*.spec.js', - {pattern: 'test/assets/**/*.html', watched: true, served: true, included: false} + {pattern: 'test/assets/**/*.html', watched: true, served: true, included: false}, + {pattern: 'lib/**/*.js', watched: true, served: false, included: false} ], + preprocessors: { + 'test/setup.js': [ 'browserify' ] + }, + exclude: [ 'test/commonjs.spec.js', 'test/microtasks.spec.js' @@ -26,7 +31,7 @@ module.exports = function (config) { logLevel: config.LOG_INFO, browsers: ['Firefox'], - frameworks: ['jasmine'], + frameworks: ['jasmine', 'browserify'], captureTimeout: 60000, diff --git a/test/setup-microtask.js b/test/setup-microtask.js new file mode 100644 index 000000000..13eecfe41 --- /dev/null +++ b/test/setup-microtask.js @@ -0,0 +1,2 @@ +// Setup tests for Zone with microtask support +require('../lib/browser/zone-microtask.js'); diff --git a/test/setup.js b/test/setup.js new file mode 100644 index 000000000..d455fd48e --- /dev/null +++ b/test/setup.js @@ -0,0 +1,2 @@ +// Setup tests for Zone without microtask support +require('../lib/browser/zone.js');