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.
This commit is contained in:
Mike Pennisi 2016-03-22 09:51:05 -04:00
parent 83b27c9beb
commit 3a3ced170e
1 changed files with 2 additions and 2 deletions

View File

@ -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:
```javascript
assert.throws(ReferenceError, function() {
1 += 1; // expect this to throw ReferenceError
assert.throws(TypeError, function() {
null(); // expect this statement to throw a TypeError
});
```