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

Automate the retrieval of w3c tests. #199

Closed
wants to merge 3 commits into from
Closed
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
@@ -1,2 +1,3 @@
/dist/
/node_modules/
/tests/w3c/
21 changes: 17 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('intern');

var version = require('./package').version;
var pkg = require('./package');
var version = pkg.version;
var header =
'/*!\n' +
' * PEP v' + version + ' | https:/jquery/PEP\n' +
' * Copyright jQuery Foundation and other contributors | http://jquery.org/license\n' +
' */\n';

var path = require('path');
var testPkg = pkg['web-platform-tests'];
var w3cPath = path.normalize(testPkg.path);

var srcFiles = ['pointerevents.js', 'src/**/*.js'];
var buildFiles = ['Gruntfile.js', 'build/**/*.js'];
var testFiles = ['tests/**/*.js'];

var testFiles = ['tests/**/*.js', '!' + path.join(w3cPath, '**', '*.js')];
var allFiles = srcFiles.concat(buildFiles).concat(testFiles);

grunt.initConfig({
Expand Down Expand Up @@ -102,8 +108,15 @@ module.exports = function(grunt) {
);
});

grunt.registerTask('pretest', function() {
var done = this.async();
var pretest = require('./tests/support/pretest');

pretest().then(done);
});

grunt.registerTask('default', ['lint', 'build', 'uglify']);
grunt.registerTask('lint', ['jscs:lint', 'jshint']);
grunt.registerTask('test', ['intern:pointerevents']);
grunt.registerTask('ci', ['lint', 'build', 'intern:ci']);
grunt.registerTask('test', ['pretest', 'intern:pointerevents']);
grunt.registerTask('ci', ['lint', 'build', 'pretest', 'intern:ci']);
};
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,24 @@
}
],
"devDependencies": {
"atob": "^1.1.2",
"bluebird": "^2.9.30",
"chai-spies": "^0.5.1",
"esperanto": "^0.6.6",
"fs-extra": "^0.19.0",
"glob": "^5.0.10",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "0.11.2",
"grunt-contrib-uglify": "^0.4.0",
"grunt-git-authors": "^3.0.0",
"grunt-jscs": "1.8.0",
"intern": "2.2.2"
"intern": "2.2.2",
"lodash": "^3.9.3",
"request": "^2.58.0"
Copy link

Choose a reason for hiding this comment

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

I know that this is opinionated but it looks like you have to download a half of the internet while getting request. Why not to use something more lighter for such a trivial task? How about got or asker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@narqo

but it looks like you have to download a half of the internet

That's a bit of a stretch. It dependencies aren't egregious and it only takes ~5 seconds to download.

Why not to use something more

Because I've used request and I trust it, it's the 4th (going on 3rd) most depended on package in npm, and it's a dev dep to boot (so not installed very frequently and only when deving).

},
"web-platform-tests": {
"repo": "w3c/web-platform-tests#ba54984aa8838342ae97aed1fc7bd3cb5499f637",
"path": "./tests/w3c"
},
"scripts": {
"test": "grunt test"
Expand Down
9 changes: 0 additions & 9 deletions pointerevents/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions pointerevents/pointerevent_button_attribute_mouse-manual.html

This file was deleted.

132 changes: 0 additions & 132 deletions pointerevents/pointerevent_capture_mouse-manual.html

This file was deleted.

Loading