diff options
author | Mike Pennisi <mike@mikepennisi.com> | 2016-03-22 09:51:05 -0400 |
---|---|---|
committer | Mike Pennisi <mike@mikepennisi.com> | 2016-03-22 09:53:56 -0400 |
commit | 3a3ced170e394b6c9283a51d0efcf335c9b2dd70 (patch) | |
tree | f26d7aae5e16b9d5709566b04ea8770690e0c58b /CONTRIBUTING.md | |
parent | 83b27c9beb7b3ea78b319148b5c82a5411a333b1 (diff) | |
download | qtdeclarative-testsuites-3a3ced170e394b6c9283a51d0efcf335c9b2dd70.tar.gz |
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.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 655cf1007..c368f65b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 }); ``` |