@@ -15,6 +15,14 @@ module.exports = function( grunt ) {
1515 clean : {
1616 files : [ 'dist' ]
1717 } ,
18+ connect : {
19+ server : {
20+ options : {
21+ port : 8000 ,
22+ base : '.'
23+ }
24+ }
25+ } ,
1826 // production pipeline tasks
1927 uglify : {
2028 options : {
@@ -27,7 +35,36 @@ module.exports = function( grunt ) {
2735 } ,
2836 // code quality tasks
2937 qunit : {
30- files : [ 'test/**/*.html' ]
38+ unit : [ 'test/**/*.html' ] ,
39+ // test other jquery versions
40+ jquery : {
41+ options : {
42+ timeout : 12000 ,
43+ urls : [
44+ 'http://localhost:8000/test/change.html?jquery=1.4.4' ,
45+ 'http://localhost:8000/test/checkValidity.html?jquery=1.4.4' ,
46+ 'http://localhost:8000/test/custom.html?jquery=1.4.4' ,
47+ 'http://localhost:8000/test/disabled.html?jquery=1.4.4' ,
48+ 'http://localhost:8000/test/email.html?jquery=1.4.4' ,
49+ 'http://localhost:8000/test/invalid.html?jquery=1.4.4' ,
50+ 'http://localhost:8000/test/novalidate.html?jquery=1.4.4' ,
51+ 'http://localhost:8000/test/pattern.html?jquery=1.4.4' ,
52+ 'http://localhost:8000/test/required.html?jquery=1.4.4' ,
53+ 'http://localhost:8000/test/submit.html?jquery=1.4.4' ,
54+ // latest
55+ 'http://localhost:8000/test/change.html?jquery=2.1.0' ,
56+ 'http://localhost:8000/test/checkValidity.html?jquery=2.1.0' ,
57+ 'http://localhost:8000/test/custom.html?jquery=2.1.0' ,
58+ 'http://localhost:8000/test/disabled.html?jquery=2.1.0' ,
59+ 'http://localhost:8000/test/email.html?jquery=2.1.0' ,
60+ 'http://localhost:8000/test/invalid.html?jquery=2.1.0' ,
61+ 'http://localhost:8000/test/novalidate.html?jquery=2.1.0' ,
62+ 'http://localhost:8000/test/pattern.html?jquery=2.1.0' ,
63+ 'http://localhost:8000/test/required.html?jquery=2.1.0' ,
64+ 'http://localhost:8000/test/submit.html?jquery=2.1.0' ,
65+ ]
66+ }
67+ }
3168 } ,
3269 jshint : {
3370 gruntfile : {
@@ -61,24 +98,25 @@ module.exports = function( grunt ) {
6198 } ,
6299 src : {
63100 files : '<%= jshint.src.src %>' ,
64- tasks : [ 'jshint:src' , 'qunit' ]
101+ tasks : [ 'jshint:src' , 'qunit:unit ' ]
65102 } ,
66103 test : {
67104 files : '<%= jshint.test.src %>' ,
68- tasks : [ 'jshint:test' , 'qunit' ]
105+ tasks : [ 'jshint:test' , 'qunit:unit ' ]
69106 } ,
70107 }
71108 } ) ;
72109
73110 // These plugins provide necessary tasks.
74111 grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
75112 grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
113+ grunt . loadNpmTasks ( 'grunt-contrib-connect' ) ;
76114 grunt . loadNpmTasks ( 'grunt-contrib-qunit' ) ;
77115 grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ;
78116 grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
79117
80118 // Default task.
81- grunt . registerTask ( 'test' , [ 'jshint' , 'qunit' ] ) ;
119+ grunt . registerTask ( 'test' , [ 'jshint' , 'connect' , ' qunit' ] ) ;
82120 grunt . registerTask ( 'produce' , [ 'clean' , 'uglify' ] ) ;
83121 grunt . registerTask ( 'default' , [ 'test' , 'produce' ] ) ;
84122
0 commit comments