Skip to content

Command not unit test friendly #438

@phdunham

Description

@phdunham

I a lot of unit tests for my code to test parsing the command line. Commander instantiates on the require('command') statement and is cached. My unit tests do not have a way to reset commander back to its initial state. Many of my unit tests fail because values from the previous unit tests inside of commander carry over.

can we get a way to create a new Commander() each time for unit testing. Or at least a function like commander.reset() to flush the previous state of commander between unit tests?
Thanks

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