Skip to content

Commit

Permalink
Add test to prevent assignment to variable directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Manish-Giri committed Jun 13, 2017
1 parent fbc5a7d commit 6e4ab3c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4341,6 +4341,7 @@
"assert(typeof player === 'string', 'message: The variable <code>player</code> should be a string');",
"assert(player === 'Montana', 'message: The value of <code>player</code> should be \"Montana\"');",
"assert(/testObj\\s*?\\[.*?\\]/.test(code),'message: You should use bracket notation to access <code>testObj</code>');",
"assert(!code.match(/player\\s*=\\s*\"|\\'\\s*Montana\\s*\"|\\'\\s*;/gi),'message: You should not assign the value <code>Montana</code> to the variable <code>player</code> directly.');",
"assert(/testObj\\s*?\\[\\s*playerNumber\\s*\\]/.test(code),'message: You should be using the variable <code>playerNumber</code> in your bracket notation');"
],
"type": "waypoint",
Expand Down

0 comments on commit 6e4ab3c

Please sign in to comment.