aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2016-03-13 13:26:10 -0400
committerMike Pennisi <mike@mikepennisi.com>2016-10-19 15:24:21 -0400
commit0d4a07ba8c179551fde110a738241da69217db52 (patch)
tree824dfff037fe83eb8046adb25b06659dbd026a10 /CONTRIBUTING.md
parent2915fe8527d06c2cb1a4780eeac37ef743c02d9f (diff)
Update documentation
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md15
1 files changed, 12 insertions, 3 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4b50e637e..25d1b05f4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -70,14 +70,21 @@ Eg: Object.prototype.toString - '[object Null]' will be returned when
'this' value is null
#### negative
-**negative**: [regex]
+**negative**: [dictionary containing **phase** and **type**]
This means the test is expected to throw an error of the given type. If no error is thrown, a test failure is reported.
-If an error is thrown, it is implicitly converted to a string. The second parameter is a regular expression that will be matched against this string. If the match fails, a test failure is reported. Thus the regular expression can match either the error name, or the message contents, or both.
+- **type**- If an error is thrown, it is implicitly converted to a string. In order for the test to pass, this value must match the name of the error constructor.
+- **phase** - Negative tests whose **phase** value is "early" must produce the specified error prior to executing code. The value "runtime" dictates that the error is expected to be produced as a result of executing the test code.
For best practices on how to use the negative tag please see Handling Errors and Negative Test Cases, below.
+For example:
+
+ negative:
+ phase: early
+ type: ReferenceError
+
#### es5id
**es5id**: [es5-test-id]
@@ -181,7 +188,9 @@ Expectations for **parsing errors** should be declared using [the `negative` fro
```javascript
/*---
-negative: SyntaxError
+negative:
+ phase: early
+ type: SyntaxError
---*/
// This `throw` statement guarantees that no code is executed in order to