Permalink
Browse files

Added an unit test for #3.

  • Loading branch information...
1 parent 1e5d51e commit 89f23656f3ae746aa618c3803a86c527e69ae8dc @SaltwaterC committed Feb 27, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 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.