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

better commonjs test (clean dist, consistent test) #1910

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the commonjs bundle used anywhere else in the dev stuff? Meaning... is it ok that we're removing it from dist completely and only running it during test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it's not used elsewhere

Copy link
Contributor

@interactivellama interactivellama Mar 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used by CommonJS users of Fuel UX and anyone that pulls in FuelUX via NPM.



};
};
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 build 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