Skip to content
Snippets Groups Projects
Commit 3a3ced17 authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Correct example in contribution guidelines

As written, the example for asserting runtime errors is written with an
early error. Because the error is expected to be reported prior to
program execution, the `assert.throws` function cannot be used to detect
it.

Demonstrate the usage of the helper function with a runtime error.
parent 83b27c9b
No related branches found
No related tags found
No related merge requests found
...@@ -193,8 +193,8 @@ var var = var; ...@@ -193,8 +193,8 @@ var var = var;
Expectations for **runtime errors** should be defined using the `assert.throws` method and the appropriate JavaScript Error constructor function: Expectations for **runtime errors** should be defined using the `assert.throws` method and the appropriate JavaScript Error constructor function:
```javascript ```javascript
assert.throws(ReferenceError, function() { assert.throws(TypeError, function() {
1 += 1; // expect this to throw ReferenceError null(); // expect this statement to throw a TypeError
}); });
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment