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

bugs and suggestions #10

Open
ghost opened this issue Aug 13, 2016 · 4 comments
Open

bugs and suggestions #10

ghost opened this issue Aug 13, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 13, 2016

Bugs

  • can run a test without tests. Time output will be 'NaN' etc. Should stop this?
  • skipped tests fails if they are alone in a suite. Same as above.
  • uncaught exception seems to act strange sometimes. See how AVA solved it.
  • only BlueBird promises seem to work. Native ES6 promises don't. Many people prefer ES6 promises when they write tests, so this will be an bug for them.

Suggestions

  • better implementation with js-reports API ?
  • static analysis of test files, specifically to discover if any use exclusive tests (i.e. test.only).
  • Ability to abort test run. Would be useful to have a way to abort the current test run. CLI users can just Cmd+C, but from the API there's currently no way to cancel the test run.
  • in AVA 'todo' can be without a callback. E.g. todo('todo'). Is that a good idea?
  • support for SourceMap?
@ben-page
Copy link
Owner

Bugs

  • can run a test without tests. Time output will be 'NaN' etc. Should stop this?
  • skipped tests fails if they are alone in a suite. Same as above.

fixed

  • uncaught exception seems to act strange sometimes. See how AVA solved it.

What do you mean "act strange"? Uncaught Exceptions crash the process just like any other node program. Since the tests are concurrent, there is no way to decide what test (or even suite) caused the uncaught exception. AVA hasn't solved this problem. In AVA each file runs in a forked node process, so they can catch uncaught exceptions per file.

I don't think this a good idea. There is still no way of know what caused the exception. In fact, it's quite likely the test that threw it already completed and has been reported as passing. By crashing node as soon as the exception is received, the process is stopping as close to the sources as possible. And an uncaught exception is a sign that the test is not designed properly.

  • only BlueBird promises seem to work. Native ES6 promises don't. Many people prefer ES6 promises when they write tests, so this will be an bug for them.

Native Promises work fine for me in my tests. Will you provide an example of the problem that you are having?

Suggestions

  • better implementation with js-reports API ?

I like js-reports in theory, but in practice it's insufficient. It's particularly poorly designed for concurrent testing and reporting suite level and hook errors. I don't plan to implement it.

  • static analysis of test files, specifically to discover if any use exclusive tests (i.e. test.only).

For what purpose?

  • Ability to abort test run. Would be useful to have a way to abort the current test run. CLI users can just Cmd+C, but from the API there's currently no way to cancel the test run.

Does any test framework provide this? What would some use this for?

Also, it's impossible to stop a running test unless it's were running in a child process.

  • in AVA 'todo' can be without a callback. E.g. todo('todo'). Is that a good idea?

This is already supported.

  • support for SourceMap?

What for? node-test isn't rewriting anything.

@ghost
Copy link
Author

ghost commented Aug 17, 2016

For static analysis. Tape discussed this, and so did Mocha, but AVA got the best discussion: avajs/ava#696

@ben-page
Copy link
Owner

ben-page commented Aug 17, 2016

node-test does not currently support dynamically generating tests, so detecting exclusive tests (via static analysis) is not needed.

@ghost
Copy link
Author

ghost commented Aug 22, 2016

Any plans for the CLI yet?

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

1 participant