Created
January 27, 2011 20:07
Revisions
-
repeatingbeats revised this gist
Jan 27, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,6 +32,7 @@ exports.groupOne = testCase({ }, nestedGroup: testCase({ setUp: function groupOneNestedSetup(cb) { console.log(arguments.callee.name); cb(); -
repeatingbeats created this gist
Jan 27, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,75 @@ /** * Example structure for nodeunit tests with nested groups and setup/teardown * functions. Run | nodeunit nodeunit_example.js | to see a printout of * function names in the order that they are called. There aren't any actual * tests here. */ process.env.NODE_ENV = 'test'; var testCase = require('nodeunit').testCase; exports.groupOne = testCase({ setUp: function groupOneSetup(cb) { console.log(arguments.callee.name); cb(); }, tearDown: function groupOneTearDown(cb) { console.log(arguments.callee.name); cb(); }, groupOneTestOne: function groupOneTestOne(test) { console.log(arguments.callee.name); test.done(); }, groupOneTestTwo: function groupOneTestTwo(test) { console.log(arguments.callee.name); test.done(); }, nestedGroup: testCase({ setUp: function groupOneNestedSetup(cb) { console.log(arguments.callee.name); cb(); }, tearDown: function groupOneNestedTearDown(cb) { console.log(arguments.callee.name); cb(); }, groupOneNestedTestOne: function groupOneNestedTestOne(test) { console.log(arguments.callee.name); test.done(); }, groupOneNestedTestTwo: function groupOneNestedTestTwo(test) { console.log(arguments.callee.name); test.done(); }, }), groupOneTestThree: function groupOneTestThree(test) { console.log(arguments.callee.name); test.done(); } }); exports.groupTwo = { groupTwoTestOne: function groupTwoTestOne(test) { console.log(arguments.callee.name); test.done(); }, groupTwoTestTwo: function groupTwoTestTwo(test) { console.log(arguments.callee.name); test.done(); } }