Merge pull request #14512 from Manish-Giri/fix/add-tests-object-properties
Add test to prevent assignment to variable directlypull/15355/head
commit
4b15554a94
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue