I'm using Mocha bdd for unit testing.
Within my specifications, multiple test cases make use of the same assertions.
I would like to pull these shared assertions out into a reusable block.
How can I do this?
I'm using Mocha bdd for unit testing.
Within my specifications, multiple test cases make use of the same assertions.
I would like to pull these shared assertions out into a reusable block.
How can I do this?
How about a plain old JavaScript function?
Object under test:
You can view the full source code for the above example here.
Here is an example of parameterized tests: