Skip to content

Commit

Permalink
Spec: Remove "todo" from Assertion event data (#119)
Browse files Browse the repository at this point in the history
* This is redundant with the information available in
  in the TestEnd event data.

* We don't know of any testing frameworks that support flipping
  the "todo" status on a per-assertion basis, nor does that
  seem likely in the future as "Todo test" is defined as a test
  with one or more expected failures.

* Presence of this in the spec was a barrier to entry as it means
  common assertion exception objects would require being cloned,
  mutated, or otherwise mapped to set accordingly.

Fixes #105.
  • Loading branch information
Krinkle authored Sep 25, 2020
1 parent 32a9e85 commit 7118646
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ class Assertion {
* @param {*} expected
* @param {String} message
* @param {String|undefined} stack
* @param {Boolean} todo
*/
constructor (passed, actual, expected, message, stack, todo) {
constructor (passed, actual, expected, message, stack) {
this.passed = passed;
this.actual = actual;
this.expected = expected;
this.message = message;
this.stack = stack;
this.todo = todo;
}
}

Expand Down
1 change: 0 additions & 1 deletion spec/cri-draft.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ The **Assertion** object contains information about a single <<assertion>>.
* `Mixed` **expected**: The expected value passed to the assertion, should be similar to `actual` for passed assertions.
* `string` **message**: Name of the actual value, or description of what the assertion validates.
* `string|undefined` **stack**: Optional stack trace. For a "passed" assertion, it is always `undefined`.
* `boolean` **todo**: Whether this assertion was part of a todo test.

It is allowed for additional non-standard properties to be added to am Assertion object, by the testing framework or a reporter.

Expand Down
2 changes: 1 addition & 1 deletion test/integration/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function normalizeTestEnd (test) {
test.runtime = 42;
}

// Only check the "passed" and any "todo" property.
// Only check the "passed" property.
// Throw away the rest of the actual assertion objects as being framework-specific.
if (test.assertions) {
test.assertions.forEach(assertion => {
Expand Down

0 comments on commit 7118646

Please sign in to comment.