Skip to content

Commit 9291815

Browse files
committed
eslint for e2e tests
1 parent deac205 commit 9291815

File tree

8 files changed

+27
-26
lines changed

8 files changed

+27
-26
lines changed

test/.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"beforeEach": true,
1515
"afterEach": true,
1616
"spyOn": true,
17-
"hasWarned": true
17+
"hasWarned": true,
18+
"casper": true
1819
},
1920

2021
"rules": {

test/e2e/commits.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ casper.on('remote.message', function (e) {
33
})
44

55
casper.test.begin('commits', 26, function (test) {
6-
6+
77
casper
88
.start('../../examples/commits/index.html')
99
.then(function () {
@@ -45,4 +45,4 @@ casper.test.begin('commits', 26, function (test) {
4545
test.done()
4646
})
4747

48-
})
48+
})

test/e2e/grid.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
casper.test.begin('grid', 73, function (test) {
2-
2+
33
casper
44
.start('../../examples/grid/index.html')
55
.then(function () {
@@ -104,11 +104,11 @@ casper.test.begin('grid', 73, function (test) {
104104
for (var i = 0; i < data.length; i++) {
105105
for (var j = 0; j < columns.length; j++) {
106106
test.assertSelectorHasText(
107-
'tr:nth-child(' + (i+1) + ') td:nth-child(' + (j+1) + ')',
107+
'tr:nth-child(' + (i + 1) + ') td:nth-child(' + (j + 1) + ')',
108108
data[i][columns[j]]
109109
)
110110
}
111111
}
112112
}
113113

114-
})
114+
})

test/e2e/markdown.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
casper.test.begin('markdown', 5, function (test) {
2-
2+
33
casper
44
.start('../../examples/markdown/index.html')
55
.then(function () {
@@ -31,8 +31,8 @@ casper.test.begin('markdown', 5, function (test) {
3131
.wait(300) // wait for debounce
3232
.then(function () {
3333
test.assertEval(function () {
34-
return document.querySelector('textarea').value
35-
=== '## yo\n\n- test\n- hi\n\n# hello'
34+
return document.querySelector('textarea').value ===
35+
'## yo\n\n- test\n- hi\n\n# hello'
3636
})
3737
test.assertEval(function () {
3838
return document.querySelector('#editor div')
@@ -47,4 +47,4 @@ casper.test.begin('markdown', 5, function (test) {
4747
test.done()
4848
})
4949

50-
})
50+
})

test/e2e/slider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// testing the content transclusion here
33

44
casper.test.begin('slider', 2, function (test) {
5-
5+
66
casper
77
.start('../../examples/slider/index.html')
88
.then(function () {
@@ -24,4 +24,4 @@ casper.test.begin('slider', 2, function (test) {
2424
test.done()
2525
})
2626

27-
})
27+
})

test/e2e/svg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global stats, valueToPoint */
22

33
casper.test.begin('svg', 18, function (test) {
4-
4+
55
casper
66
.start('../../examples/svg/index.html')
77
.then(function () {
@@ -56,4 +56,4 @@ casper.test.begin('svg', 18, function (test) {
5656
test.done()
5757
})
5858

59-
})
59+
})

test/e2e/todomvc.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global __utils__ */
22

33
casper.test.begin('todomvc', 69, function (test) {
4-
4+
55
casper
66
.start('../../examples/todomvc/index.html')
77
.then(function () {
@@ -36,7 +36,7 @@ casper.test.begin('todomvc', 69, function (test) {
3636
test.assertVisible('#main', '#main should now be visible')
3737
test.assertVisible('#footer', '#footer should now be visible')
3838
test.assertNotVisible('#clear-completed', '#clear-completed should be hidden')
39-
test.assertField({type:'css',path:'#new-todo'}, '', 'new todo input should be reset')
39+
test.assertField({type: 'css', path: '#new-todo'}, '', 'new todo input should be reset')
4040

4141
})
4242

@@ -244,7 +244,7 @@ casper.test.begin('todomvc', 69, function (test) {
244244
test.assertElementCount('.todo', 3, 'item should have been deleted')
245245
})
246246

247-
//test toggle all
247+
// test toggle all
248248
.thenClick('#toggle-all', function () {
249249
test.assertElementCount('.todo.completed', 3, 'should toggle all items to completed')
250250
})
@@ -265,8 +265,8 @@ casper.test.begin('todomvc', 69, function (test) {
265265
}
266266
casper.evaluate(function () {
267267
// casper.mouseEvent can't set keyCode
268-
var field = document.getElementById('new-todo'),
269-
e = document.createEvent('HTMLEvents')
268+
var field = document.getElementById('new-todo')
269+
var e = document.createEvent('HTMLEvents')
270270
e.initEvent('keyup', true, true)
271271
e.keyCode = 13
272272
field.dispatchEvent(e)
@@ -275,17 +275,17 @@ casper.test.begin('todomvc', 69, function (test) {
275275

276276
function doubleClick (selector) {
277277
casper.evaluate(function (selector) {
278-
var el = document.querySelector(selector),
279-
e = document.createEvent('MouseEvents')
278+
var el = document.querySelector(selector)
279+
var e = document.createEvent('MouseEvents')
280280
e.initMouseEvent('dblclick', true, true, null, 1, 0, 0, 0, 0, false, false, false, false, 0, null)
281281
el.dispatchEvent(e)
282282
}, selector)
283283
}
284284

285285
function keyUp (code) {
286286
casper.evaluate(function (code) {
287-
var input = document.querySelector('.todo:nth-child(1) .edit'),
288-
e = document.createEvent('HTMLEvents')
287+
var input = document.querySelector('.todo:nth-child(1) .edit')
288+
var e = document.createEvent('HTMLEvents')
289289
e.initEvent('keyup', true, true)
290290
e.keyCode = code
291291
input.dispatchEvent(e)
@@ -299,4 +299,4 @@ casper.test.begin('todomvc', 69, function (test) {
299299
})
300300
}
301301

302-
})
302+
})

test/e2e/tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
casper.test.begin('tree', 22, function (test) {
2-
2+
33
casper
44
.start('../../examples/tree/index.html')
55
.then(function () {
@@ -52,4 +52,4 @@ casper.test.begin('tree', 22, function (test) {
5252
test.done()
5353
})
5454

55-
})
55+
})

0 commit comments

Comments
 (0)