-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
npm test does not work #1160
Comments
Can you try installing lodash again ( |
Also you should avoid using |
for sure, let me give it a go thanks |
I got it to work by reinstalling lodash however, there is one test fail
|
the reason I was looking into your tests is because I am developing a new test runner (Suman) for Node that will go head-to-head with AVA one of the pluses of Suman is that it can transpile Mocha tests to Suman tests, because the Suman API adheres closely to Mocha's API (whereas AVA adheres closer to Tape's). I cloned the async repo and added a directory with Suman tests: you will see that if you run your test suite with Mocha (npm test), it takes about 12 seconds for Mocha to run (more than 12 for the linting etc) and everything is run in a single process. I have to say your test suite is pretty clean, and there doesn't appear to be any crossover between tests. But in any case, when running your test suite with Suman, it runs under 6 seconds, so it's a > 50% decrease in time. This may not be super important, but test isolation is a great feature, and it will basically force you to keep tests independent. Given that each test is run in a separate process, Suman has a lot of features/prescriptions to allow for code reuse and loading of asynchronous dependencies. Suman is not quite ready, but if you're interested I can ping you again later. I would highly appreciate any feedback you have if you do take the time to try running Suman on this library. To do so:
it should run in less than half the time that Mocha takes if you're interested in playing with suman further you can check out the Github repo for it my account, Suman has a cli of course, so the above command would normally be:
thanks |
Ye thats a known issue (#1152) and I'm interested at least in an async test runner (was looking at AVA) (see #849). I'll play around with you're project whne I get a chance. |
Yep, the same test case failed for both Suman and Mocha. Suman has big advantages over AVA, the Suman readme covers a lot of it. But you will have just witnessed one big advantage of Suman for projects currently using Mocha - you can convert pretty much automatically from Mocha to Suman. Suman runs each test file in a separate proc, and instead of running all hooks and test cases in series, it allows test cases and hooks to run in parallel, if so desired. Of your current test suites, everything was parallelizable except this file: socket.io-socket.js |
@ORESoftware similar to AVA, suman is not going to be entirely appropriate for us to change to as we will want browser testing (done through karma). A future avenue you can perhaps explore is a) being able to convert mocha tests dynamically so suman can run on a mocha suite b) making a synchronous task runner (similar to tape) which can be run in the browser. Regardless, I'm still going to play with your project and see how I like it. |
yeah, definitely understand WRT browser testing; supporting browser puts too much burden and constraints on Suman - I want Suman's competitive advantage to be that it is not have to support browser. Your idea to dynamically run mocha tests with suman as harness would be interesting - will explore, it is possible, not a bad idea at all. |
I am working on adding a test to the test suite
but when I run "npm test" I get
"Error: Cannot find module 'lodash/rest'"
e.g.:
definitely seems to be a problem, I even tried transpiling separately on my own with babel-cli and running separately with mocha without the --compilers arg and I get the same error - I am not that familiar with ES2015 import statements so not sure how to figure out what's wrong.
The text was updated successfully, but these errors were encountered: