Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Running setup code before a test suite in Node Unit

Running setup code before a test suite in Node Unit

Problem

When writing automated system/integration tests, it's common for the first step to run before all of the tests to be "start the server." Since starting a server can be expensive, it is desirable to do this one time, not before each individual test. JUnit has easy functionality for doing this. Is there an equivalent standard pattern in nodeunit? Or does it require hand rolling something?

Problem courtesy of: James Kingsbery

Solution

I don't think Nodeunit has this built-in, but many folks handle such tasks with Grunt.

http://gruntjs.com/

Solution courtesy of: Brad

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Running setup code before a test suite in Node Unit

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×