You can get pretty far with the plain assert module. If you do however, I recommend the following:
1. Keep each test file small; it's okay to have hundreds of files. 2. Throw on error, this produces a lovely stack trace. It makes tracking down test failures easy. 3. Exit non-zero on failure; throwing will do automatically. 4. On a successful test run, print a single line "ok" and exit 0. Printing "ok" helps reduce the chance that the test just didn't run, but somehow exited 0. 5. Use a test-coordinator that just runs all the tests together, and aggregates the results. Tests should be nearly silent on success, and noisy on error. On Sun, Jan 12, 2014 at 8:06 PM, Forrest L Norvell <[email protected]>wrote: > I started with mocha + chai + SinonJS (Sinon is similar to Ruby's mocha - > mocks, spies and stubs, and some limited timecop-style time manipulation > capabilities), and if you're doing typical web app development, those three > make for a pretty broad and powerful sweet spot. However, if you're working > with stuff that touches the bare runtime (i.e. you're manipulating > eventEmitters or writing your own error-handling framework), mocha has a > number of behaviors that make it less than ideal. I've been switching my > tests over to use Isaac's node-tap, and if you want something even simpler, > there's substack's tape. > > For some of the stuff I do, even that's got too much stuff going on to > work with the (very low-level) tests I've been writing, so I've been > writing a few, important test cases using bare JavaScript and the built-in > assert module. I mention it here because it's really not that bad; with > just a little work you can write your own tests to produce TAP-compatible > output, and then use it with a test runner like the one included with > node-tap. > > To get back to your original questions, because the most common format in > JavaScript for fixtures is just straight-up JSON, which is very easy to > programmatically generate from inside JavaScript, I haven't seen anything > like factorygirl get traction in the Node world. For a replacement for > capybara, I've seen people using various webdriver modules, cheerio, or > zombie, it seems like something like PhantomJS or CasperJS is the best bet > long-term. > > F > > > > On Sun, Jan 12, 2014 at 7:33 PM, P. Douglas Reeder <[email protected]>wrote: > >> I looked over what was available a couple months ago, and Mocha+Chai has >> everything I wanted (and everything team members are likely to want, >> also). >> >> I prefer to drive Selenium directly, without Capybara in the way (I've >> used it, and encountered problems which I couldn't rule out as being >> Capybara's fault -- though we were using an old version). >> >> >> On Sunday, January 12, 2014 1:46:33 PM UTC-5, Scott wrote: >>> >>> In ruby/rails my test suite was test.unit/minitest, rspec, factory girl, >>> and capybara. >>> >>> For node, I have found mocha and chai that look promising. Is there >>> anything like factory girl and capybara that works on node/express? Is >>> there any other software i should check out? >>> >>> Thanks, >>> Scott >>> >>> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "nodejs" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
