brillout/libassert

What are the Methods/functions in Soft Assertion?

Closed this issue · 5 comments

Hello,

I want the execution to continue even if the assertion validation fails.
So choosing the soft assertion like mentioned in the below link:
https://npm.runkit.com/assertion-soft

However, I am unable to find the methods which can be used for validate the actual value against the expected value.
The below code is throwing error saying "TypeError: assertionSoft.equal is not a function":
var assertionSoft = require("assertion-soft")
var assertResult = assert.equal(("expected",
"actual", 'Element check for the ' + element + ' is failed');

Please provide the relevant method.

assertion-soft is deprecated and has been replaced with const assert_warning = require('reassert/warning');.

assert_warning(false, "warning bla bla..."); will not throw but only print the "warning bla bla..." message with the stack trace.

Feel free to re-open.

Thanks for the reply. Request you to reopen the issue:
Using assert_warning is not validating the actual versus expected value.
Also, in the runkit its throwing the error.
Could you please provide a correct syntax to verify the actual value versus the expected value.
Please find the attached screenshot of the run kit:
assertwarningerror
assertwarningerror

In https://npm.runkit.com/reassert

run

var assert_warning = require("reassert/warning")

assert_warning(false, "bla bla");

Hi brillout,
We are using Cucumber Framework and test cases have been written in Feature Files.

Basically we want to achieve 3 objectives as below:

  1. expected vs actual comparison syntax
  2. There are 10 steps(lines)of assertion in the feature file and if 5th line fails, the execution should still continue and execute 6th to 10th steps.
  3. In the report the failed step(i.e 5th Step) should be clearly marked as "Failed". Thus we can clearly make out 9 out of 10 steps passed and 1 failed.

Can we achieve this using "var assert_warning = require("reassert/warning")" ????

Sounds like reassert is not what you are looking for