Skip to content

Commit

Permalink
Added an unit test for #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltwaterC committed Feb 27, 2012
1 parent 1e5d51e commit 89f2365
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/mime-wrapper-multiple.js
@@ -0,0 +1,35 @@
var mime = require('../');
var assert = require('assert');

var callback = false;

var files = [
'data/foo.txt.bz2',
'data/foo.txt.gz',
'data/foo.txt.zip',
'data/foo.txt.tar',
'data/foo.pdf',
'data/foo.txt'
];

var expected = [
'application/x-bzip2',
'application/x-gzip',
'application/zip',
'application/x-tar',
'application/pdf',
'text/plain'
];

mime.fileWrapper(files, function (err, res) {
callback = true;
assert.ifError(err);
console.log(res);
for (var i in res) {
assert.deepEqual(res[i], expected[i]);
}
});

process.on('exit', function () {
assert.ok(callback);
});

0 comments on commit 89f2365

Please sign in to comment.