Skip to content

Not all reporters support recursion. #347

Open

Description

@rquadling

Just started using nodeunit. It seems not all the reporters support the recursive option.

It seems recursive: options.recursive, is missing from the call to nodeunit.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.

Activity

  1. mreinstein commented on Jan 10, 2018

    @mreinstein
    Collaborator

    @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

  2. rquadling commented on Jan 10, 2018

    @rquadling
    Author

    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

  3. mreinstein commented on Jan 10, 2018

    @mreinstein
    Collaborator

    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.

  4. 0joshuaolson1 commented on Feb 19, 2018

    @0joshuaolson1

    nodeunit is not under very active development

    @mreinstein This would go great in the README or project description.

  5. mreinstein commented on Feb 19, 2018

    @mreinstein
    Collaborator

    This would go great in the README or project description.

    @0joshuaolson1 I'd accept a PR for this

  6. mreinstein commented on Feb 19, 2018

    @mreinstein
    Collaborator

    send a proper pull request please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions