-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not all reporters support recursion. #347
Comments
@rquadling you'll probably be better served exploring other testing frameworks. nodeunit is not under very active development. There are other modern and very active projects. My personal favorite is https://github.com/tapjs/node-tap |
Being completely new to JS unit testing, one thing I liked was how I could easily may the concepts of our PHPUnit testing (data providers, testcases, methods) to nodeunit. Very similar code layout. Would you be able to "convert" one of our node unit tests to tap as an example? None of the team I'm with are expert enough yet, so we are learning from those that know more. https://gist.github.com/rquadling/457b5f4a7a3b01bd9df68e623bdc8fc5 |
I'm not going to convert an entire unit test, but here's a stripped down example to get you started: 'use strict'
const Calculator = require(__dirname + '/../Digitickets').Calculator
const tap = require('tap')
tap.test('basic calculator functionality', function(test) {
const calculator = new Calculator()
test.equals(calculator.getAmountTendered(), 0.00,
'Amount Tendered starts at 0.00 for ' + testName)
test.equals(calculator.getChange(), 0.00, 'Change Given starts at 0.00 for ' + testName)
// ... further tests follow...
test.end()
})
tap.test('some other calculator test', function(test) {
// TODO: assertions go here
test.end()
}) I'd recommend taking a look at http://www.node-tap.org/basics I think you'll find these examples are pretty simple and you shouldn't have any trouble writing tap tests should you decide to do so. |
@mreinstein This would go great in the README or project description. |
@0joshuaolson1 I'd accept a PR for this |
send a proper pull request please |
Just started using nodeunit. It seems not all the reporters support the recursive option.
It seems
recursive: options.recursive,
is missing from the call tonodeunit.runFiles()
in at least eclipse, html, junit, minimal, nested, skip-passed and verbose.I can see where the missing option is missing from lcov and machineout, but in my limited testing, I couldn't see a difference ... or ANY output!
I have amended my installed nodeunit and get the recursion as expected.
I can create a patch (#348), but I'm not sure about proof/testing. Ideally, I'd like to know how to add tests to prove that the recursion is operational, but if the fix is correct and a super obvious oversight, then maybe it wouldn't be necessary.
The text was updated successfully, but these errors were encountered: