Closed rstacruz closed 8 years ago
I don't think that keep such a lot of files in the repository is good. I'd recommend you to keep this integration tests as is, but also add some unit tests on fetch.js
module. Now we have got a nock - it is an HTTP-mocking library, that allows you to write this kind of tests with ease.
Then you can not to run integration tests every time if you considering them very slow for you (btw, in Travis they run two times faster than your results)
How about a middleground — let's keep sepia
but gitignore fixtures
? this way, local tests will be fast without the bloat.
I'm currently using the integration tests to quickly develop a patch for #61 :)
Okay, done as that. Fixtures are now not committed to the repo, so local runs will be cached perfectly without extra bloat :)
Not sure about that one. Realistically we should mock out the entire registry anyways. Was thinking about using something like this: https://github.com/npm/npm-registry-mock
Thoughts?
i think it's pretty cool that the tests run against the actual registry. that way we can uncover strange test cases that appear in actual packages. if any package is reported to be defective, we can just add it in... which we can't do on npm-registry-mock.
Can you rebase? Happy to merge.
here we go!
btw we can do this too:
# travis.yml
cache:
directories:
- node_modules
- fixtures
but i'm not sure how that'll interact with having multiple node.js versions.
Uhh hmm.. they should run in isolation I think... so that shouldn't be an issue...
Thanks!
Tests are very slow because they simulate
ied install
:This speeds it up considerably by caching HTTP requests:
This does it by caching the HTTP requests into the repo itself.
It comes with 25MB of dataFixtures are .gitignored, so this only affects running the tests locally on your machines.