Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Using nodeunit's deepEqual instead of manually looping.
Browse files Browse the repository at this point in the history
This makes for more readable assertion messages (so you can actually see the difference in the lists), and removes the underscore dependency.
  • Loading branch information
domenic committed May 14, 2012
1 parent 99342e0 commit 828798c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
},

"devDependencies": {
"nodeunit": ">= 0.6.4",
"underscore": ">= 1.3.1"
"nodeunit": ">= 0.6.4"
},

"main": "./lib/wrench",
Expand Down
7 changes: 1 addition & 6 deletions tests/readdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var testCase = require('nodeunit').testCase;
var fs = require('fs');
var wrench = require('../lib/wrench');
var path = require('path');
var _und = require("underscore");


function checkResult(test, files) {
Expand All @@ -15,11 +14,7 @@ function checkResult(test, files) {
'foo/bar/ipsum.js'
];

test.equals(files.length, check.length, 'number of paths is correct');

_und.each(check, function(it) {
test.ok(_und.include(files, it), 'path ' + it + ' should be returned');
});
test.deepEqual(files, check);

test.done();
}
Expand Down

0 comments on commit 828798c

Please sign in to comment.