Browse Source

update tests

contingency-plan
Rich Harris 10 years ago
parent
commit
5cd2208714
  1. 5
      test/function/custom-path-resolver-async/_config.js
  2. 6
      test/function/custom-path-resolver-sync/_config.js

5
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;
}

6
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;
}

Loading…
Cancel
Save