Saturday, May 11, 2024
185
rated 0 times [  192] [ 7]  / answers: 1 / hits: 16339  / 12 Years ago, wed, april 11, 2012, 12:00:00

I'm introducing unit testing in my project and for this, I need to make myself a package.json file.



First question is, which unit testing suite are you using? I'm looking forward mocha which seem to be pretty much standard for Node.js projects.



Second question is: Is there any magical way of generating a package.json file? (for dependencies and versions)



Third question is: I've been testing a lot of npm packages while developing my project and now I'm stuck with a lot of probably unused packages. Is there any way to tell which one are useless? (I saw npm list installed which is useful though)


More From » unit-testing

 Answers
6

  1. I am also using Mocha. It has code coverage, BDD, TDD, runs in browser. It is pretty complete and also heavily maintained by I think one of the most brilliant javascript/node.js programmers named TJ.


  2. It is almost impossible to guess which version(s) to use. Because npm does not know which version breaks which dependencies. You could probably install all dependencies using something like node-detective. Then you can just install them using npm.js from within javascript. Maybe I would like to tackle this in the future.


  3. I would also probably delete all dependencies , next install needed dependencies back using step(2). But also disc-space is not such a big case anymore with the current HDs.




P.S: I think I also agree with Domenic


[#86309] Tuesday, April 10, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
annalieset

Total Points: 733
Total Questions: 92
Total Answers: 109

Location: Greenland
Member since Fri, Jul 31, 2020
4 Years ago
annalieset questions
Sun, Jun 12, 22, 00:00, 2 Years ago
Fri, Aug 13, 21, 00:00, 3 Years ago
Wed, Oct 7, 20, 00:00, 4 Years ago
;