Skip to content

Commit

Permalink
fix(rules): handling 'browser.driver' correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alecxe committed Dec 23, 2016
1 parent feb2d08 commit 8a04033
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/rules/no-browser-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ module.exports = {
},

create: function (context) {
// console.log(context)
return {
'MemberExpression': function (node) {
var object = node.object
if (object.name === 'browser') {
// when trying `var d = browser.driver;`
object = node
}
if (object.object && object.object.name === 'browser' &&
object.property && object.property.name === 'driver') {
var property = node.property

if (object && object.name === 'browser' && property && property.name === 'driver') {
context.report({
node: node,
message: 'Unexpected use of browser.driver instead of browser'
Expand Down

0 comments on commit 8a04033

Please sign in to comment.