Skip to content
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
46 changes: 42 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ module.exports = function( grunt ) {
clean: {
files: [ 'dist' ]
},
connect: {
server: {
options: {
port: 8000,
base: '.'
}
}
},
// production pipeline tasks
uglify: {
options: {
Expand All @@ -27,7 +35,36 @@ module.exports = function( grunt ) {
},
// code quality tasks
qunit: {
files: [ 'test/**/*.html' ]
unit: [ 'test/**/*.html' ],
// test other jquery versions
jquery: {
options: {
timeout: 12000,
urls: [
'http://localhost:8000/test/change.html?jquery=1.4.4',
'http://localhost:8000/test/checkValidity.html?jquery=1.4.4',
'http://localhost:8000/test/custom.html?jquery=1.4.4',
'http://localhost:8000/test/disabled.html?jquery=1.4.4',
'http://localhost:8000/test/email.html?jquery=1.4.4',
'http://localhost:8000/test/invalid.html?jquery=1.4.4',
'http://localhost:8000/test/novalidate.html?jquery=1.4.4',
'http://localhost:8000/test/pattern.html?jquery=1.4.4',
'http://localhost:8000/test/required.html?jquery=1.4.4',
'http://localhost:8000/test/submit.html?jquery=1.4.4',
// latest
'http://localhost:8000/test/change.html?jquery=2.1.0',
'http://localhost:8000/test/checkValidity.html?jquery=2.1.0',
'http://localhost:8000/test/custom.html?jquery=2.1.0',
'http://localhost:8000/test/disabled.html?jquery=2.1.0',
'http://localhost:8000/test/email.html?jquery=2.1.0',
'http://localhost:8000/test/invalid.html?jquery=2.1.0',
'http://localhost:8000/test/novalidate.html?jquery=2.1.0',
'http://localhost:8000/test/pattern.html?jquery=2.1.0',
'http://localhost:8000/test/required.html?jquery=2.1.0',
'http://localhost:8000/test/submit.html?jquery=2.1.0',
]
}
}
},
jshint: {
gruntfile: {
Expand Down Expand Up @@ -61,24 +98,25 @@ module.exports = function( grunt ) {
},
src: {
files: '<%= jshint.src.src %>',
tasks: [ 'jshint:src', 'qunit' ]
tasks: [ 'jshint:src', 'qunit:unit' ]
},
test: {
files: '<%= jshint.test.src %>',
tasks: [ 'jshint:test', 'qunit' ]
tasks: [ 'jshint:test', 'qunit:unit' ]
},
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-connect' );
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );

// Default task.
grunt.registerTask( 'test', [ 'jshint', 'qunit' ]);
grunt.registerTask( 'test', [ 'jshint', 'connect', 'qunit' ]);
grunt.registerTask( 'produce', [ 'clean', 'uglify' ]);
grunt.registerTask( 'default', [ 'test', 'produce' ]);

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "html5.constraintValidationAPI",
"title": "HTML5 constraintValidationAPI",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/bboyle/html5-constraint-validation-API",
"authors": [
"Ben Boyle <benjamins.boyle@gmail.com>"
Expand Down
6 changes: 3 additions & 3 deletions dist/html5.constraintValidationAPI.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "html5.constraintValidationAPI",
"title": "HTML5 constraintValidationAPI",
"description": "A polyfill for the HTML5 constraintValidationAPI",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/bboyle/html5-constraint-validation-API",
"author": {
"name": "Ben Boyle",
Expand Down Expand Up @@ -36,7 +36,8 @@
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-jshint": "~0.9.2",
"grunt-contrib-qunit": "~0.4.0"
"grunt-contrib-qunit": "~0.4.0",
"grunt-contrib-connect": "~0.7.1"
},
"scripts": {
"test": "grunt test"
Expand Down
4 changes: 2 additions & 2 deletions test/checkValidity.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// setup - detect invalid events
var invalidDetectedOnFoo = 0;

$( '#foo' ).on( 'invalid.TEST', function() {
$( '#foo' ).bind( 'invalid.TEST', function() {
invalidDetectedOnFoo++;
strictEqual( invalidDetectedOnFoo, 1, 'invalid event detected on foo' );
});
Expand All @@ -42,7 +42,7 @@
strictEqual( $( '#foo' )[ 0 ].checkValidity(), true, 'foo is valid' );

// teardown
$( '#foo' ).on( 'invalid.TEST' );
$( '#foo' ).unbind( 'invalid.TEST' );
});


Expand Down