Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
better commonjs test (clean dist, consistent test)
Browse files Browse the repository at this point in the history
- 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
swilliamset committed Dec 15, 2016
1 parent 8b8fbe0 commit 341d2f8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FUEL_CDN.yml

# Generated file from commonjs-test.js
test/commonjs-bundle.js
dist/npm.js

# Editors / IDEs
.idea
Expand Down
24 changes: 0 additions & 24 deletions dist/js/npm.js

This file was deleted.

3 changes: 2 additions & 1 deletion grunt/config/clean.js
Original file line number Diff line number Diff line change
@@ -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']
};
};
4 changes: 2 additions & 2 deletions grunt/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);


};
};
14 changes: 10 additions & 4 deletions grunt/tasks/test.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 () {
Expand Down

0 comments on commit 341d2f8

Please sign in to comment.