From 4f350b44c43c9419330adc5ff024c568d9a5bab7 Mon Sep 17 00:00:00 2001 From: Ian MacLeod Date: Fri, 3 Oct 2014 15:20:12 -0700 Subject: [PATCH] Support ?build=min for the test suite; and grunt test-min --- gruntfile.js | 10 +++++++++- load.js | 12 +++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index f6fd839..4b7c8b0 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -12,9 +12,15 @@ module.exports = function(grunt) { local: { options: {remote: false}, }, + 'local-min': { + options: {remote: false, webRunner: 'test/index.html?build=min'}, + }, remote: { options: {remote: true}, }, + 'remote-min': { + options: {remote: true, webRunner: 'test/index.html?build=min'}, + }, }, concat: { modules: { @@ -31,6 +37,8 @@ module.exports = function(grunt) { grunt.registerTask('default', 'concat'); grunt.registerTask('test', ['wct-test:local']); + grunt.registerTask('test-min', ['concat', 'wct-test:local-min']); grunt.registerTask('test-remote', ['wct-test:remote']); - grunt.registerTask('test-buildbot', ['wct-test:local']); + grunt.registerTask('test-remote-min', ['concat', 'wct-test:remote-min']); + grunt.registerTask('test-buildbot', ['test-min']); }; diff --git a/load.js b/load.js index 9a8b6e4..c1c04e4 100644 --- a/load.js +++ b/load.js @@ -20,9 +20,11 @@ document.write(''); - [ - '../observe-js/src/observe.js', - '../NodeBind/src/NodeBind.js', - 'src/TemplateBinding.js' - ].forEach(write); + write('../observe-js/src/observe.js'); + write('../NodeBind/src/NodeBind.js'); + if (window.WCT && (WCT.util.getParam('build') === 'min' || WCT.util.getParam('build') === 'min/')) { + write('TemplateBinding.min.js'); + } else { + write('src/TemplateBinding.js'); + } })();