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' ); var assert = require( 'assert' );
module.exports = { module.exports = {
@ -7,8 +8,10 @@ module.exports = {
var Promise = require( 'sander' ).Promise; var Promise = require( 'sander' ).Promise;
var resolved; var resolved;
if ( importee === path.resolve( __dirname, 'main.js' ) ) return importee;
if ( importee === 'foo' ) { if ( importee === 'foo' ) {
resolved = require( 'path' ).resolve( __dirname, 'bar.js' ); resolved = path.resolve( __dirname, 'bar.js' );
} else { } else {
resolved = false; resolved = false;
} }

6
test/function/custom-path-resolver-sync/_config.js

@ -1,12 +1,12 @@
var path = require( 'path' );
var assert = require( 'assert' ); var assert = require( 'assert' );
module.exports = { module.exports = {
description: 'uses a custom path resolver (synchronous)', description: 'uses a custom path resolver (synchronous)',
options: { options: {
resolvePath: function ( importee, importer ) { resolvePath: function ( importee, importer ) {
if ( importee === 'foo' ) { if ( importee === path.resolve( __dirname, 'main.js' ) ) return importee;
return require( 'path' ).resolve( __dirname, 'bar.js' ); if ( importee === 'foo' ) return path.resolve( __dirname, 'bar.js' );
}
return false; return false;
} }

Loading…
Cancel
Save