-
Notifications
You must be signed in to change notification settings - Fork 159
Update tests to use Intern #167
Changes from 3 commits
d0e0584
efdc8c1
e383909
97d4708
be47ddd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"browser": true, | ||
"expr": true, | ||
"predef": [ "define" ], | ||
"undef": true, | ||
"unused": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
cache: | ||
directories: | ||
- node_modules | ||
install: | ||
- "travis_retry npm install grunt-cli" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is needed. From the Travis docs:
|
||
- "travis_retry npm install" | ||
script: | ||
- "grunt ci" |
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']); | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't intern be listed here? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. :)