Skip to content

Commit e75e783

Browse files
committed
feat: Require Node.js >= 6
Use JS Standard instead of Goolge coding style. BREAKING CHANGE: Require Node.js >= 6
1 parent 74ede4f commit e75e783

37 files changed

+637
-642
lines changed

.eslintrc

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

Gruntfile.js

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
'use strict';
1+
'use strict'
22

33
module.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+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ your code using Grunt.
497497
498498
## Release History
499499
500+
* 2018-03-11 [v1.0.0] Require Node.js >= 6
500501
* 2018-03-11 [v0.8.0] Add a new instruction - "abort"
501502
* 2018-03-01 [v0.7.0] Add optional automatic file numbering
502503
* 2018-02-28 [v0.6.0] Add the allRequired option to the hasClass instruction

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
}
2424
],
2525
"engines": {
26-
"node": ">= 4"
26+
"node": ">= 6"
2727
},
2828
"scripts": {
2929
"prepare": "test `node --version | cut -c 2` -ne 4 && nsp check || echo 'No vulnerabilities check possible on Node.js 4'",
30+
"lint": "grunt standard",
3031
"test": "grunt",
3132
"coverage": "grunt instrument && GRUNT_HTML_DOM_SNAPSHOT_COVERAGE=1 grunt",
3233
"coveralls": "test `node --version | cut -c 2` -eq 8 && npm run coverage && grunt coveralls",
@@ -44,9 +45,9 @@
4445
"grunt-contrib-connect": "^1.0.2",
4546
"grunt-contrib-nodeunit": "^1.0.0",
4647
"grunt-coveralls": "^1.0.1",
47-
"grunt-eslint": "^20.1.0",
4848
"grunt-istanbul": "^0.8.0",
4949
"grunt-selenium-standalone": "^1.0.1",
50+
"grunt-standard": "^3.1.0",
5051
"nsp": "^3.2.1",
5152
"phantomjs-prebuilt": "^2.1.16",
5253
"semantic-release": "^15.0.2",

0 commit comments

Comments
 (0)