1- 'use strict' ;
1+ 'use strict'
22
33module . exports = function ( grunt ) {
4- const coverage = process . env . GRUNT_HTML_DOM_SNAPSHOT_COVERAGE ;
4+ const coverage = process . env . GRUNT_HTML_DOM_SNAPSHOT_COVERAGE
55
66 grunt . initConfig ( {
7- eslint : {
8- target : [
9- 'Gruntfile.js' ,
10- 'tasks/**/*.js' ,
11- '<%= nodeunit.tests %>'
12- ]
7+ standard : {
8+ all : {
9+ src : [
10+ 'Gruntfile.js' ,
11+ 'tasks/**/*.js' ,
12+ '<%= nodeunit.tests %>'
13+ ]
14+ }
1315 } ,
1416
1517 instrument : {
@@ -115,7 +117,7 @@ module.exports = function (grunt) {
115117 {
116118 url : 'http://localhost:8881/test/pages/dynamic-custom.html' ,
117119 wait : function ( browser ) {
118- return browser . waitForExist ( '.dynamic' , 1000 ) ;
120+ return browser . waitForExist ( '.dynamic' , 1000 )
119121 } ,
120122 file : 'dynamic-custom'
121123 } ,
@@ -148,9 +150,9 @@ module.exports = function (grunt) {
148150 return browser . getUrl ( )
149151 . then ( function ( url ) {
150152 if ( url !== 'http://localhost:8881/test/pages/no-doctype.html' ) {
151- throw new Error ( 'go:back failed' ) ;
153+ throw new Error ( 'go:back failed' )
152154 }
153- } ) ;
155+ } )
154156 }
155157 } ,
156158 {
@@ -159,9 +161,9 @@ module.exports = function (grunt) {
159161 return browser . getUrl ( )
160162 . then ( function ( url ) {
161163 if ( url !== 'http://localhost:8881/test/pages/dynamic-multiple.html' ) {
162- throw new Error ( 'go:forward failed' ) ;
164+ throw new Error ( 'go:forward failed' )
163165 }
164- } ) ;
166+ } )
165167 }
166168 } ,
167169 {
@@ -170,9 +172,9 @@ module.exports = function (grunt) {
170172 return browser . getUrl ( )
171173 . then ( function ( url ) {
172174 if ( url !== 'http://localhost:8881/test/pages/dynamic-multiple.html' ) {
173- throw new Error ( 'go:forward failed' ) ;
175+ throw new Error ( 'go:forward failed' )
174176 }
175- } ) ;
177+ } )
176178 }
177179 } ,
178180 {
@@ -183,9 +185,9 @@ module.exports = function (grunt) {
183185 return browser . hasFocus ( 'input' )
184186 . then ( function ( value ) {
185187 if ( value !== true ) {
186- throw new Error ( 'click failed' ) ;
188+ throw new Error ( 'click failed' )
187189 }
188- } ) ;
190+ } )
189191 }
190192 } ,
191193 {
@@ -197,9 +199,9 @@ module.exports = function (grunt) {
197199 return browser . getValue ( 'input' )
198200 . then ( function ( value ) {
199201 if ( value !== 'Hi' ) {
200- throw new Error ( 'setValue failed' ) ;
202+ throw new Error ( 'setValue failed' )
201203 }
202- } ) ;
204+ } )
203205 }
204206 } ,
205207 {
@@ -211,9 +213,9 @@ module.exports = function (grunt) {
211213 return browser . getValue ( 'input' )
212214 . then ( function ( value ) {
213215 if ( value !== 'Hi there!' ) {
214- throw new Error ( 'addValue failed' ) ;
216+ throw new Error ( 'addValue failed' )
215217 }
216- } ) ;
218+ } )
217219 }
218220 } ,
219221 {
@@ -222,9 +224,9 @@ module.exports = function (grunt) {
222224 return browser . getValue ( 'input' )
223225 . then ( function ( value ) {
224226 if ( value !== '' ) {
225- throw new Error ( 'clearValue failed' ) ;
227+ throw new Error ( 'clearValue failed' )
226228 }
227- } ) ;
229+ } )
228230 }
229231 } ,
230232 {
@@ -233,9 +235,9 @@ module.exports = function (grunt) {
233235 return browser . getValue ( 'input' )
234236 . then ( function ( value ) {
235237 if ( value !== 'test' ) {
236- throw new Error ( 'sending text failed' ) ;
238+ throw new Error ( 'sending text failed' )
237239 }
238- } ) ;
240+ } )
239241 }
240242 } ,
241243 {
@@ -244,9 +246,9 @@ module.exports = function (grunt) {
244246 return browser . getValue ( 'input' )
245247 . then ( function ( value ) {
246248 if ( value !== 'est' ) {
247- throw new Error ( 'sending key strokes failed' , value ) ;
249+ throw new Error ( 'sending key strokes failed' , value )
248250 }
249- } ) ;
251+ } )
250252 }
251253 } ,
252254 {
@@ -429,22 +431,22 @@ module.exports = function (grunt) {
429431 }
430432 }
431433 }
432- } ) ;
434+ } )
433435
434- grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
435- grunt . loadNpmTasks ( 'grunt-contrib-connect' ) ;
436- grunt . loadNpmTasks ( 'grunt-contrib-nodeunit' ) ;
437- grunt . loadNpmTasks ( 'grunt-coveralls' ) ;
438- grunt . loadNpmTasks ( 'grunt-eslint' ) ;
439- grunt . loadNpmTasks ( 'grunt-istanbul' ) ;
440- grunt . loadNpmTasks ( 'grunt-selenium-standalone' ) ;
441- grunt . loadTasks ( coverage ? 'coverage/tasks' : 'tasks' ) ;
436+ grunt . loadNpmTasks ( 'grunt-contrib-clean' )
437+ grunt . loadNpmTasks ( 'grunt-contrib-connect' )
438+ grunt . loadNpmTasks ( 'grunt-contrib-nodeunit' )
439+ grunt . loadNpmTasks ( 'grunt-coveralls' )
440+ grunt . loadNpmTasks ( 'grunt-istanbul' )
441+ grunt . loadNpmTasks ( 'grunt-selenium-standalone' )
442+ grunt . loadNpmTasks ( 'grunt-standard' )
443+ grunt . loadTasks ( coverage ? 'coverage/tasks' : 'tasks' )
442444
443- const test = [ 'clean' , 'eslint ' ,
444- 'selenium_standalone:server:install' ,
445- 'selenium_standalone:server:start' ,
446- 'connect' , 'html-dom-snapshot' ,
447- 'selenium_standalone:server:stop' , 'nodeunit' ] ,
448- report = coverage ? [ 'storeCoverage' , 'makeReport' ] : [ ] ;
449- grunt . registerTask ( 'default' , test . concat ( report ) ) ;
450- } ;
445+ const test = [ 'clean' , 'standard ' ,
446+ 'selenium_standalone:server:install' ,
447+ 'selenium_standalone:server:start' ,
448+ 'connect' , 'html-dom-snapshot' ,
449+ 'selenium_standalone:server:stop' , 'nodeunit' ]
450+ const report = coverage ? [ 'storeCoverage' , 'makeReport' ] : [ ]
451+ grunt . registerTask ( 'default' , test . concat ( report ) )
452+ }
0 commit comments