Skip to content

Flag to show pending/hanging tests. #781

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

Closed
radiovisual opened this issue Apr 24, 2016 · 10 comments
Closed

Flag to show pending/hanging tests. #781

radiovisual opened this issue Apr 24, 2016 · 10 comments

Comments

@radiovisual
Copy link

radiovisual commented Apr 24, 2016

I have a use case where I am testing functionality that sometimes causes the test run to hang. When a test causes the terminal to hang, I don't always know what test is hanging unless I go through the very tedious and manual process of using the --verbose flag and comparing my tests one-by-one with AVA's output.

It would be awesome If I could pass some sort of flag/option (or the --verbose option is modified to be even more verbose), then I could see which tests are currently pending, which would narrow down my search to find the hanging test.

@sindresorhus
Copy link
Member

Could you share such test? Just curious what makes it hang.

@radiovisual
Copy link
Author

Sure. Right now I am troubleshooting a part of my application, and I am writing a test to ensure that an error is thrown, I have the following test, which sometimes causes the test run to hang in the terminal:

test('should throw when local-config.js is not found', t => {
    const birdwatch = new Birdwatch({server: false, testData: false}).feed('testfeed');
    t.throws(birdwatch.start(), Error('local-config.js file not found.'));
});

It took me a little while to figure out which test was causing the test run to hang, which is why it would have been a big time-saver to have some sort of flag that could help narrow down the pending/hanging tests.

@sindresorhus
Copy link
Member

You're using t.throws incorrectly? Is that intentional? What exactly made it hang?

@radiovisual
Copy link
Author

radiovisual commented Apr 24, 2016

Yes, in that example I am using t.throws() incorrectly, which does cause the test run to hang. However, I wasn't able to narrow down my problematic test until after I had gone through a pretty tedious test-by-test comparison to figure out which test was hanging.

Though, I am still working to find the exact bug/reason why the application is hanging in my tests.

@radiovisual
Copy link
Author

Update: The only reason I can gather that makes that particular test to hang is the incorrect usage of t.throws(). When I use t.throws() correctly, the test run no longer hangs.

@jamestalmage
Copy link
Contributor

Would #583 be enough to solve your problem?

@sindresorhus
Copy link
Member

The only reason I can gather that makes that particular test to hang is the incorrect usage of t.throws()

Too bad this happened now. If you'd used master (not that you should have), AVA would have warned you about it: 3201b1b

@radiovisual
Copy link
Author

radiovisual commented Apr 24, 2016

yeah, I recall seeing that a warning for improper use of t.throws() was merged into master not long ago, so as soon as I realized the problem I was having with my tests, the first thought that came to mind was how that feature would have helped me. 😄

@radiovisual
Copy link
Author

radiovisual commented Apr 24, 2016

@jamestalmage, I do think that #583 would be enough to solve the problem, as long as a "hanging" test would be classified by AVA as a "pending" test. 👍

@jamestalmage
Copy link
Contributor

Closing in favor of #583. (Hanging === Pending)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants