From 711864634eb395c4fb29231f16755c46051b4beb Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 25 Sep 2020 22:36:22 +0100 Subject: [PATCH] Spec: Remove "todo" from Assertion event data (#119) * 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 https://github.com/js-reporters/js-reporters/issues/105. --- lib/Data.js | 4 +--- spec/cri-draft.adoc | 1 - test/integration/adapters.js | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Data.js b/lib/Data.js index 6152343..68a8717 100644 --- a/lib/Data.js +++ b/lib/Data.js @@ -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; } } diff --git a/spec/cri-draft.adoc b/spec/cri-draft.adoc index e6ea247..9ea0cd4 100644 --- a/spec/cri-draft.adoc +++ b/spec/cri-draft.adoc @@ -254,7 +254,6 @@ The **Assertion** object contains information about a single <>. * `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. diff --git a/test/integration/adapters.js b/test/integration/adapters.js index 7aa7dfa..a505525 100644 --- a/test/integration/adapters.js +++ b/test/integration/adapters.js @@ -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 => {