Skip to content

Commit a016874

Browse files
author
Tom Hanoldt
committed
add tests for jquery>=1.10, >=2, >=3 (+slim version)
1 parent 5d5abcd commit a016874

File tree

7 files changed

+1298
-2085
lines changed

7 files changed

+1298
-2085
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ before_script:
66
- npm install -g grunt-cli bower
77
- bower install
88

9-
script: grunt test --verbose
9+
script: grunt test-all-jquery-versions --verbose

Gruntfile.coffee

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,36 @@ module.exports = (grunt) ->
3030
build:
3131
files: 'dist/jquery.input.validator.min.js': 'dist/jquery.input.validator.js'
3232
jasmine:
33-
specs:
33+
jquery1:
3434
src: 'dist/jquery.input.validator.js'
3535
options:
3636
specs: 'tmp/spec/*spec.js'
3737
vendor: [
38-
"bower_components/jquery/dist/jquery.min.js"
38+
"bower_components/jquery-1/jquery.min.js"
39+
"bower_components/jasmine-jquery-legacy/lib/jasmine-jquery.js"
40+
]
41+
jquery2:
42+
src: 'dist/jquery.input.validator.js'
43+
options:
44+
specs: 'tmp/spec/*spec.js'
45+
vendor: [
46+
"bower_components/jquery-2/dist/jquery.min.js"
47+
"bower_components/jasmine-jquery/lib/jasmine-jquery.js"
48+
]
49+
jquery3:
50+
src: 'dist/jquery.input.validator.js'
51+
options:
52+
specs: 'tmp/spec/*spec.js'
53+
vendor: [
54+
"bower_components/jquery-3/dist/jquery.min.js"
55+
"bower_components/jasmine-jquery/lib/jasmine-jquery.js"
56+
]
57+
jquery3Slim:
58+
src: 'dist/jquery.input.validator.js'
59+
options:
60+
specs: 'tmp/spec/*spec.js'
61+
vendor: [
62+
"bower_components/jquery-3/dist/jquery.slim.min.js"
3963
"bower_components/jasmine-jquery/lib/jasmine-jquery.js"
4064
]
4165
watch:
@@ -56,7 +80,18 @@ module.exports = (grunt) ->
5680
'uglify'
5781
]
5882

83+
grunt.registerTask 'lint', [
84+
'includes'
85+
'coffeelint'
86+
]
87+
5988
grunt.registerTask 'test', [
89+
'includes'
90+
'coffee'
91+
'jasmine:jquery3'
92+
]
93+
94+
grunt.registerTask 'test_all', [
6095
'includes'
6196
'coffee'
6297
'jasmine'

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ It also exposes the class `InputValidator` for manual instantiating.
134134

135135

136136
### Dependencies
137-
* [jquery](https://jquery.com)
137+
* [jquery](https://jquery.com) (>=v1.1, >=2, >=3 (+slim))
138138

139139
### Resources
140140
* https://github.com/creative-workflow/jquery.input.validator
@@ -149,7 +149,9 @@ It also exposes the class `InputValidator` for manual instantiating.
149149
* `npm run test`
150150

151151
#### Run tests and linter
152+
* `npm run lint`
152153
* `npm run test`
154+
* `npm run test-all-jquery-versions`
153155

154156
#### Generate build
155157
* `npm run build`
@@ -162,6 +164,7 @@ It also exposes the class `InputValidator` for manual instantiating.
162164
### WIP: 1.0.3
163165
* refactor `onBuildErrorHint`
164166
* clear input events
167+
* add tests for jquery>=1.10, >=2, >=3 (+slim version)
165168

166169
### 1.0.2
167170
* fix error hint

bower.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"jasmine-jquery": ">=2.1.0"
2525
},
2626
"dependencies": {
27-
"jquery": ">=1.7.0"
27+
"jquery-1": "jquery#1.10",
28+
"jquery-2": "jquery#2",
29+
"jquery-3": "jquery#3"
2830
}
2931
}

0 commit comments

Comments
 (0)