Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adapted async test

  • Loading branch information...
commit c9111d293ab35fb611d9c65ea2f88ae8cf853f8e 1 parent f4b02e3
@substack authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/async.js
View
21 test/async.js
@@ -0,0 +1,21 @@
+var test = require('tap').test;
+var resolve = require('../');
+
+test('async foo', function (t) {
+ t.plan(3);
+ var dir = __dirname + '/resolver';
+
+ resolve('./foo', { basedir : dir }, function (err, res) {
+ if (err) t.fail(err);
+ t.equal(res, dir + '/foo.js');
+ });
+
+ resolve('./foo.js', { basedir : dir }, function (err, res) {
+ if (err) t.fail(err);
+ t.equal(res, dir + '/foo.js');
+ });
+
+ resolve('foo', { basedir : dir }, function (err) {
+ t.equal(err.message, "Cannot find module 'foo'");
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.