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

Update tests to use Intern #167

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
7 changes: 7 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"browser": true,
"expr": true,
"predef": [ "define" ],
"undef": true,
"unused": true
}
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo: false
language: node_js
node_js:
- "0.10"
Copy link

Choose a reason for hiding this comment

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

This already seems like outdated?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not latest, but certainly not outdated.

Copy link

Choose a reason for hiding this comment

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

I know but why not to directly include the latest one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it work? Does it do what we need it to do? Great. Don’t fix what isn’t broken. :)

cache:
directories:
- node_modules
install:
- "travis_retry npm install grunt-cli"
Copy link

Choose a reason for hiding this comment

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

I don't think this is needed. From the Travis docs:

grunt-cli is provided for pre-installed Node.js 0.8 and up (including io.js 1.1.0)

- "travis_retry npm install"
script:
- "grunt ci"
120 changes: 62 additions & 58 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-git-authors');
grunt.loadNpmTasks('intern');

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-git-authors');
var version = require('./package').version;
var header =
'/*!\n' +
' * PEP v' + version + ' | https://github.com/jquery/PEP\n' +
' * Copyright jQuery Foundation and other contributors | http://jquery.org/license\n'+
' */\n';

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

grunt.initConfig({
uglify: {
pointerevents: {
grunt.initConfig({
uglify: {
pointerevents: {
options: {
preserveComments: 'some'
},
nonull: true,
dest: 'dist/PEP.min.js',
src: 'dist/PEP.js'
}
},
intern: {
options: {
preserveComments: 'some'
runType: 'runner'
},
nonull: true,
dest: 'dist/PEP.min.js',
src: 'dist/PEP.js'
}
},
karma: {
options: {
configFile: 'karma.conf.js',
keepalive: true
},
pointerevents: {
},
buildbot: {
reporters: 'crbot',
logLevel: 'OFF'
pointerevents: {
options: {
config: 'tests/intern-local'
}
},
ci: {
options: {
config: 'tests/intern'
}
}
}
}
});
});

grunt.registerTask('build', function() {
var esperanto = require('esperanto');
var done = this.async();
grunt.registerTask('build', function() {
var esperanto = require('esperanto');
var done = this.async();

grunt.log.write('Building PEP...');
esperanto.bundle({
base: 'src',
entry: '../pointerevents.js'
}).then(function (bundle) {
var umd = bundle.toUmd({
name: 'PointerEventsPolyfill'
});
grunt.file.write('dist/PEP.js', header + umd.code);
}).then(
function() {
grunt.log.ok();
done();
},
function(error) {
grunt.log.error();
done(error);
}
);
});

grunt.registerTask('default', ['build', 'uglify']);
grunt.registerTask('test', ['override-chrome-launcher', 'karma:pointerevents']);
grunt.registerTask('test-buildbot', ['override-chrome-launcher', 'karma:buildbot']);
grunt.log.write('Building PEP...');
esperanto.bundle({
base: 'src',
entry: '../pointerevents.js'
}).then(function (bundle) {
var umd = bundle.toUmd({
name: 'PointerEventsPolyfill',
sourceMap: true,
sourceMapFile: 'dist/PEP.js'
});
grunt.file.write('dist/PEP.js', header + umd.code);
grunt.file.write('dist/PEP.js.map', umd.map.toString());
}).then(
function() {
grunt.log.ok();
done();
},
function(error) {
grunt.log.error();
done(error);
}
);
});

grunt.registerTask('default', ['build', 'uglify']);
grunt.registerTask('test', ['intern:pointerevents']);
grunt.registerTask('ci', ['build', 'intern:ci']);
};
31 changes: 0 additions & 31 deletions karma.conf.js

This file was deleted.

15 changes: 3 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@
"description": "Polyfill of the PointerEvents W3C spec",
"directories": {
"doc": "docs",
"test": "test"
"test": "tests"
},
"devDependencies": {
"chai": "^1.9.1",
"chai-spies": "^0.5.1",
"esperanto": "^0.6.6",
"intern": "2.2.2",
"grunt": "~0.4.1",
"grunt-contrib-uglify": "^0.4.0",
"grunt-git-authors": "^3.0.0",
"grunt-karma": "*",
"karma": "~0.12.0",
"karma-crbot-reporter": "*",
"karma-firefox-launcher": "^0.1.3",
"karma-ie-launcher": "*",
"karma-mocha": "*",
"karma-safari-launcher": "~0.1.1",
"karma-script-launcher": "*",
"mocha": "*"
"grunt-git-authors": "^3.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't intern be listed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It totally was there the whole time and I didn’t force push a replacement commit to the branch to make it show up on line 12. Ahem. 😊

},
"scripts": {
"test": "grunt test"
Expand Down
126 changes: 0 additions & 126 deletions test/capture.js

This file was deleted.

50 changes: 0 additions & 50 deletions test/constructor.js

This file was deleted.

Loading