Fix stack trace error in javascript challenge
- added a additional check to make sure the function exists
This commit is contained in:
parent
7e3be9adea
commit
1627faf2f0
@ -1841,8 +1841,8 @@
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof myFunction === 'function', 'message: <code>myFunction</code> should be a function');",
|
||||
"capture(); myFunction(1,2); uncapture(); assert(logOutput == 3, 'message: <code>myFunction(1,2)</code> should output <code>3</code>');",
|
||||
"capture(); myFunction(7,9); uncapture(); assert(logOutput == 16, 'message: <code>myFunction(7,9)</code> should output <code>16</code>');",
|
||||
"if(typeof myFunction === \"function\") { capture(); myFunction(1,2); uncapture(); } assert(logOutput == 3, 'message: <code>myFunction(1,2)</code> should output <code>3</code>');",
|
||||
"if(typeof myFunction === \"function\") { capture(); myFunction(7,9); uncapture(); } assert(logOutput == 16, 'message: <code>myFunction(7,9)</code> should output <code>16</code>');",
|
||||
"assert(/^\\s*myFunction\\(\\s*\\d+\\s*,\\s*\\d+\\s*\\)\\s*;/m.test(code), 'message: Call <code>myFunction</code> after you define it');"
|
||||
],
|
||||
"type": "waypoint",
|
||||
|
Loading…
x
Reference in New Issue
Block a user