Permalink
Browse files

better commonjs test (clean dist, consistent test)

- removed commonjs testing resource (js/npm.js) from dist folder
- buld dist task no longer leaves dist/js/npm.js in zip
- moved creation of resources for commonjs into prep test task
- test dist task now preps for commonjs tasks and cleans up
  • Loading branch information...
1 parent 8b8fbe0 commit 341d2f824dc2436c99bf20927a40c3f3364808bf @swilliamset swilliamset committed Dec 9, 2016
Showing with 15 additions and 31 deletions.
  1. +1 −0 .gitignore
  2. +0 −24 dist/js/npm.js
  3. +2 −1 grunt/config/clean.js
  4. +2 −2 grunt/tasks/build.js
  5. +10 −4 grunt/tasks/test.js
View
@@ -20,6 +20,7 @@ FUEL_CDN.yml
# Generated file from commonjs-test.js
test/commonjs-bundle.js
+dist/npm.js
# Editors / IDEs
.idea
View
@@ -1,24 +0,0 @@
-// This file has been created by the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
-require('jquery');
-require('bootstrap');
-
-require('../../js/checkbox');
-require('../../js/combobox');
-require('../../js/datepicker');
-require('../../js/dropdown-autoflip');
-require('../../js/loader');
-require('../../js/placard');
-require('../../js/radio');
-require('../../js/search');
-require('../../js/selectlist');
-require('../../js/spinbox');
-require('../../js/tree');
-require('../../js/utilities');
-require('../../js/wizard');
-require('../../js/infinite-scroll');
-require('../../js/pillbox');
-require('../../js/repeater');
-require('../../js/repeater-list');
-require('../../js/repeater-thumbnail');
-require('../../js/scheduler');
-require('../../js/picker');
@@ -1,5 +1,6 @@
module.exports = {
+ commonjs: ['dist/js/npm.js', 'test/commonjs-bundle.js'],
dist: ['dist'],
zipsrc: ['dist/fuelux'],
screenshots: ['page-at-timeout-*.jpg']
-};
+};
@@ -28,7 +28,7 @@ module.exports = function(grunt) {
// Full distribution task
grunt.registerTask('dist', 'Build "dist." Contributors: do not commit "dist."',
- ['clean:dist', 'distcss', 'copy:fonts', 'copy:templates', 'distjs', 'commonjs', 'distzip']);
+ ['clean:dist', 'distcss', 'copy:fonts', 'copy:templates', 'distjs', 'distzip']);
-};
+};
View
@@ -1,15 +1,21 @@
module.exports = function test (grunt) {
// to be run prior to submitting a PR
grunt.registerTask('test', 'run jshint, qunit source w/ coverage, and validate HTML',
- ['browserify:commonjs', 'dist', 'jshint', 'connect:testServer', 'qunit:noMoment', 'qunit:globals', 'qunit:dist', 'htmllint', 'resetdist']);
+ ['jshint', 'connect:testServer', 'qunit:noMoment', 'qunit:globals', 'test-dist', 'htmllint']);
+
+ grunt.registerTask('prep-commonjs-test', 'run commonjs config buiild and browserify to prep for commonjs test',
+ ['commonjs', 'browserify:commonjs']);
+
+ grunt.registerTask('test-dist', 'run jshint, qunit source w/ coverage, and validate HTML',
+ ['dist', 'prep-commonjs-test', 'qunit:dist', 'clean:commonjs']);
// If qunit:source is working but qunit:full is breaking, check to see if the dist broke the code. This would be especially useful if we start mangling our code, but, is 99.99% unlikely right now
grunt.registerTask('validate-dist', 'run qunit:source, dist, and then qunit:full',
- ['connect:testServer', 'qunit:source', 'dist', 'browserify:commonjs', 'qunit:dist']);
+ ['connect:testServer', 'qunit:source', 'test-dist']);
// multiple jQuery versions, then run SauceLabs VMs
grunt.registerTask('releasetest', 'run jshint, build dist, all source tests, validation, and qunit on SauceLabs',
- ['test', 'dist', 'browserify:commonjs', 'qunit:dist', 'saucelabs-qunit:defaultBrowsers']);
+ ['test', 'saucelabs-qunit:defaultBrowsers']);
// Due to TravisCI security concerns, Saucelabs can not be run for PRs from forks. Therefore, it can not become part of our PR process.
// https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
@@ -18,7 +24,7 @@ module.exports = function test (grunt) {
['connect:testServer', 'jshint', 'saucelabs-qunit:defaultBrowsers']);
grunt.registerTask('travisci', 'Tests to run when in Travis CI environment',
- ['browserify:commonjs', 'test', 'dist', 'qunit:dist']);
+ ['test']);
// if you've already accidentally added your files for commit, this will at least unstage them. If you haven't, this will wipe them out.
grunt.registerTask('resetdist', 'resets changes to dist to keep them from being checked in', function resetdist () {

0 comments on commit 341d2f8

Please sign in to comment.