Skip to content

Commit f4d1841

Browse files
committed
fix: nightwatch helper compat with airbnb linter
close #870
1 parent 00ec67b commit f4d1841

File tree

1 file changed

+5
-4
lines changed
  • packages/@vue/cli-plugin-e2e-nightwatch/generator/template/test/e2e/custom-assertions

1 file changed

+5
-4
lines changed

Diff for: packages/@vue/cli-plugin-e2e-nightwatch/generator/template/test/e2e/custom-assertions/elementCount.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
// For more information on custom assertions see:
88
// http://nightwatchjs.org/guide#writing-custom-assertions
99

10-
exports.assertion = function (selector, count) {
10+
exports.assertion = function elementCount (selector, count) {
1111
this.message = `Testing if element <${selector}> has count: ${count}`
1212
this.expected = count
1313
this.pass = val => val === count
1414
this.value = res => res.value
15-
this.command = cb => this.api.execute(function (selector) {
16-
return document.querySelectorAll(selector).length
17-
}, [selector], cb)
15+
function evaluator (_selector) {
16+
return document.querySelectorAll(_selector).length
17+
}
18+
this.command = cb => this.api.execute(evaluator, [selector], cb)
1819
}

0 commit comments

Comments
 (0)