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

Commit 2cd43a7

Browse files
committed
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
1 parent 7cb7900 commit 2cd43a7

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ FUEL_CDN.yml
2020

2121
# Generated file from commonjs-test.js
2222
test/commonjs-bundle.js
23+
dist/npm.js
2324

2425
# Editors / IDEs
2526
.idea

dist/js/npm.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

grunt/config/clean.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
2+
commonjs: ['dist/js/npm.js', 'test/commonjs-bundle.js'],
23
dist: ['dist'],
34
zipsrc: ['dist/fuelux'],
45
screenshots: ['page-at-timeout-*.jpg']
5-
};
6+
};

grunt/tasks/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function(grunt) {
2828

2929
// Full distribution task
3030
grunt.registerTask('dist', 'Build "dist." Contributors: do not commit "dist."',
31-
['clean:dist', 'distcss', 'copy:fonts', 'copy:templates', 'distjs', 'commonjs', 'distzip']);
31+
['clean:dist', 'distcss', 'copy:fonts', 'copy:templates', 'distjs', 'distzip']);
3232

3333

34-
};
34+
};

grunt/tasks/test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
module.exports = function test (grunt) {
22
// to be run prior to submitting a PR
33
grunt.registerTask('test', 'run jshint, qunit source w/ coverage, and validate HTML',
4-
['jshint', 'connect:testServer', 'qunit:noMoment', 'qunit:globals', 'qunit:dist', 'htmllint']);
4+
['jshint', 'connect:testServer', 'qunit:noMoment', 'qunit:globals', 'test-dist', 'htmllint']);
5+
6+
grunt.registerTask('prep-commonjs-test', 'run commonjs config buiild and browserify to prep for commonjs test',
7+
['commonjs', 'browserify:commonjs']);
8+
9+
grunt.registerTask('test-dist', 'run jshint, qunit source w/ coverage, and validate HTML',
10+
['dist', 'prep-commonjs-test', 'qunit:dist', 'clean:commonjs']);
511

612
// 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
713
grunt.registerTask('validate-dist', 'run qunit:source, dist, and then qunit:full',
8-
['connect:testServer', 'qunit:source', 'dist', 'browserify:commonjs', 'qunit:dist']);
14+
['connect:testServer', 'qunit:source', 'test-dist']);
915

1016
// multiple jQuery versions, then run SauceLabs VMs
1117
grunt.registerTask('releasetest', 'run jshint, build dist, all source tests, validation, and qunit on SauceLabs',
12-
['test', 'dist', 'browserify:commonjs', 'qunit:dist', 'saucelabs-qunit:defaultBrowsers']);
18+
['test', 'saucelabs-qunit:defaultBrowsers']);
1319

1420
// Due to TravisCI security concerns, Saucelabs can not be run for PRs from forks. Therefore, it can not become part of our PR process.
1521
// https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
@@ -18,7 +24,7 @@ module.exports = function test (grunt) {
1824
['connect:testServer', 'jshint', 'saucelabs-qunit:defaultBrowsers']);
1925

2026
grunt.registerTask('travisci', 'Tests to run when in Travis CI environment',
21-
['browserify:commonjs', 'test', 'dist', 'qunit:dist']);
27+
['test']);
2228

2329
// 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.
2430
grunt.registerTask('resetdist', 'resets changes to dist to keep them from being checked in', function resetdist () {

0 commit comments

Comments
 (0)