Skip to content

Commit 3f58797

Browse files
author
Tom Hanoldt
committed
refactor specs
1 parent 461efdd commit 3f58797

13 files changed

+285
-220
lines changed

Gruntfile.coffee

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,22 @@ module.exports = (grunt) ->
6666
banner: '# <% includes.files.dest %>'
6767

6868
coffee:
69-
compile:
69+
dist:
70+
options:
71+
sourceMap: true
7072
files:
7173
'dist/jquery.input.validator.js': 'build/jquery.input.validator.coffee'
72-
'build/spec/rules.spec.js': 'spec/rules.spec.coffee'
74+
specs:
75+
options:
76+
sourceMap: true
77+
flatten: false
78+
expand: false
79+
files:
80+
'build/spec/helper.js': 'spec/helper.coffee'
7381
'build/spec/controller.spec.js': 'spec/controller.spec.coffee'
74-
'build/spec/reset.spec.js': 'spec/reset.spec.coffee'
75-
'build/spec/hint.spec.js': 'spec/hint.spec.coffee'
82+
'build/spec/hint.spec.js': 'spec/hint.spec.coffee'
83+
'build/spec/reset.spec.js': 'spec/reset.spec.coffee'
84+
'build/spec/rules.spec.js': 'spec/rules.spec.coffee'
7685

7786
coffeelint:
7887
app:
@@ -87,33 +96,41 @@ module.exports = (grunt) ->
8796
exec:
8897
npm_publish: 'npm publish'
8998

99+
clean:
100+
build: 'build'
101+
dist: 'dist'
102+
90103
jasmine:
91104
jquery1:
92105
src: 'dist/jquery.input.validator.js'
93106
options:
94-
specs: 'build/spec/*spec.js'
107+
specs: 'build/spec/*spec.js'
108+
helpers: 'build/spec/*helper.js'
95109
vendor: [
96110
"bower_components/jquery-1/jquery.min.js"
97111
"bower_components/jasmine-jquery-legacy/lib/jasmine-jquery.js"
98112
]
99113
jquery2:
100114
src: 'dist/jquery.input.validator.js'
101115
options:
102-
specs: 'build/spec/*spec.js'
116+
specs: 'build/spec/*spec.js'
117+
helpers: 'build/spec/*helper.js'
103118
vendor: [
104119
"bower_components/jquery-2/dist/jquery.min.js"
105120
"bower_components/jasmine-jquery/lib/jasmine-jquery.js"
106121
]
107122
jquery3:
108123
src: 'dist/jquery.input.validator.js'
109124
options:
110-
specs: 'build/spec/*spec.js'
125+
specs: 'build/spec/*spec.js'
126+
helpers: 'build/spec/*helper.js'
111127
vendor: [
112128
"bower_components/jquery-3/dist/jquery.min.js"
113129
"bower_components/jasmine-jquery/lib/jasmine-jquery.js"
114130
]
115131
jquery3Slim:
116-
src: 'dist/jquery.input.validator.js'
132+
specs: 'build/spec/*spec.js'
133+
helpers: 'build/spec/*helper.js'
117134
options:
118135
specs: 'build/spec/*spec.js'
119136
vendor: [
@@ -130,7 +147,7 @@ module.exports = (grunt) ->
130147
if key != 'grunt' and key.indexOf('grunt') == 0
131148
grunt.loadNpmTasks key
132149

133-
grunt.registerTask 'code', [ 'includes', 'coffee', 'replace:dist', 'replace:bower' ]
150+
grunt.registerTask 'code', [ 'clean', 'includes', 'coffee', 'replace:dist', 'replace:bower' ]
134151

135152
grunt.registerTask 'lint', [ 'includes', 'coffeelint' ]
136153

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ It also exposes the class `InputValidator` for manual instantiating.
163163
## Changelog
164164
### WIP: 1.0.3
165165
* refactor `onBuildErrorHint`
166-
* clear input events
166+
* clear input events before attaching
167167
* add tests for jquery>=1.10, >=2, >=3 (+slim version)
168+
* more automations tasks
169+
* introduce test helper
170+
* refactor specs
168171

169172
### 1.0.2
170173
* fix error hint

dist/jquery.input.validator.js

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.input.validator.js.map

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.input.validator.min.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

package-lock.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"coffeelint": "^1.16.0",
1515
"grunt": "^1.0.2",
1616
"grunt-coffeelint": "0.0.16",
17+
"grunt-contrib-clean": "^1.1.0",
1718
"grunt-contrib-coffee": "^1.0.0",
1819
"grunt-contrib-jasmine": "^1.1.0",
1920
"grunt-contrib-uglify": "^3.0.1",

0 commit comments

Comments
 (0)