From 5cd2208714ef833e5cab7f5dd69c520c21cdf947 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 18 Jun 2015 20:21:08 -0400 Subject: [PATCH] update tests --- test/function/custom-path-resolver-async/_config.js | 5 ++++- test/function/custom-path-resolver-sync/_config.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/function/custom-path-resolver-async/_config.js b/test/function/custom-path-resolver-async/_config.js index acb62d0..82ed21a 100644 --- a/test/function/custom-path-resolver-async/_config.js +++ b/test/function/custom-path-resolver-async/_config.js @@ -1,3 +1,4 @@ +var path = require( 'path' ); var assert = require( 'assert' ); module.exports = { @@ -7,8 +8,10 @@ module.exports = { var Promise = require( 'sander' ).Promise; var resolved; + if ( importee === path.resolve( __dirname, 'main.js' ) ) return importee; + if ( importee === 'foo' ) { - resolved = require( 'path' ).resolve( __dirname, 'bar.js' ); + resolved = path.resolve( __dirname, 'bar.js' ); } else { resolved = false; } diff --git a/test/function/custom-path-resolver-sync/_config.js b/test/function/custom-path-resolver-sync/_config.js index a7cd96b..4df8fcf 100644 --- a/test/function/custom-path-resolver-sync/_config.js +++ b/test/function/custom-path-resolver-sync/_config.js @@ -1,12 +1,12 @@ +var path = require( 'path' ); var assert = require( 'assert' ); module.exports = { description: 'uses a custom path resolver (synchronous)', options: { resolvePath: function ( importee, importer ) { - if ( importee === 'foo' ) { - return require( 'path' ).resolve( __dirname, 'bar.js' ); - } + if ( importee === path.resolve( __dirname, 'main.js' ) ) return importee; + if ( importee === 'foo' ) return path.resolve( __dirname, 'bar.js' ); return false; }