Giter Site home page Giter Site logo

Ideas for implementation about nodeunit HOT 7 CLOSED

caolan avatar caolan commented on May 27, 2024
Ideas for implementation

from nodeunit.

Comments (7)

caolan avatar caolan commented on May 27, 2024

Yes, discussion is a good idea :)

possibility to mark a test as TODO
Not sure I see much of a use for this, perhaps you have some example use cases? I want to be careful not to overcomplicate test running.

ability to skip tests
Perhaps this could be achieved by adding a 'condition' function to testCase, along with the setUp and tearDown functions? However, I think I'd be tempted to just split these tests into different directories and have your test script or makefile use different directories as a target.

Group naming
I absolutely agree. This probably means updating the testrunner api to accept an array for the name instead of a string.

Removal of stacktrace
Sometimes they are useful, sometimes not. There is a lot of nodeunit noise in there, but usually the line number the test failed on makes it in there too. If you were to implement this I think it should be as a command-line option to the testrunner.

...in summary, I'm yet to be convinced by the first two. I'd definitely like to see the third idea implemented, and the final one I'd be happy to accept as an option to the testrunner.

from nodeunit.

azatoth avatar azatoth commented on May 27, 2024

possibility to mark a test as TODO

It is related to removal of stacktrace, for example if you write many tests in advance, you don't want the output to be littered with stacktraces.
Also it gives a hint that the test is assumed to fail, and that it is not an regression.

ability to skip tests

That is why I said some of the reasons are merely syntactic sugar. The major reason though is to skip multiple tests if one or more single test fails.

Removal of stacktrace

I only think that current filename and current test function is of need; perhaps also line number. The other nine rows of stack trace sadly doesn't help much :(

from nodeunit.

caolan avatar caolan commented on May 27, 2024

If there is a reliable way to clean up the stacktrace, that would be good.

from nodeunit.

azatoth avatar azatoth commented on May 27, 2024

There is http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
I tried it a bit, but didn't get hang of it much.

from nodeunit.

azatoth avatar azatoth commented on May 27, 2024

I would say only include stack traces down to inside nodeunit.js

from nodeunit.

Sannis avatar Sannis commented on May 27, 2024

ability to skip tests

  • A test should not be run if a test that tests relevant dependency fails
  • A test might not be testable if no network connection exists
  • A test might be expensive is computation, and might not be run often
  • A test might not be applicable on certain hardware
  • A sub type of skip could also be to be able to skip the test of a whole group if a test fails, but still test all other tests.

I think this must be into wscript or Makefile. Group of tests with some dependency can be placed into one file or folder, for example. There are many cases where some test should be skipped and I think all of them shouldn't be implemented in test suite.

from nodeunit.

caolan avatar caolan commented on May 27, 2024

I'm going to open separate issues for group naming and stacktrace improvements.

from nodeunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.