Skip to content
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

CLI failure test doesn't appear to test what it claims #758

Closed
jtlapp opened this issue Sep 25, 2017 · 0 comments
Closed

CLI failure test doesn't appear to test what it claims #758

jtlapp opened this issue Sep 25, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@jtlapp
Copy link
Contributor

@jtlapp jtlapp commented Sep 25, 2017

The description of the following test claims to test a consequence of reporter errors, but it actually tests what happens when a test directory does not exist.

    it('exits with code 1 when function returns error with multiple reporters', (done) => {

        RunCli(['test/cli_failure/failure.js', '-r', 'console', '-r', 'lcov'], (error, result) => {

            if (error) {
                done(error);
            }

            expect(result.code).to.equal(1);
            done();
        });
    });

The directory cli_failure does not exist, and that is what causes the test runner to fail and thus the test to pass. Reporters have no effect on the outcome.

On a related note, for a PR I'm doing, when should the exit code be 0 and when should it be 1? In one place it's 0 for not matching a command line pattern, and in another place it's 1 for missing a lab script.

(My PR breaks this test by exiting with 0 under this condition instead of with 1.)

@geek geek added test bug labels Nov 13, 2018
@geek geek self-assigned this Nov 13, 2018
@geek geek added this to the 18.0.0 milestone Nov 13, 2018
@geek geek closed this in #894 Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.