diff --git a/test/function/custom-path-resolver-plural/_config.js b/test/function/custom-path-resolver-plural/_config.js new file mode 100644 index 0000000..dd63a44 --- /dev/null +++ b/test/function/custom-path-resolver-plural/_config.js @@ -0,0 +1,23 @@ +var path = require( 'path' ); +var assert = require( 'assert' ); + +module.exports = { + description: 'uses custom path resolvers (plural)', + options: { + resolveId: [ + function ( importee ) { + if ( importee[0] === '@' ) + return path.resolve( __dirname, 'globals-' + importee.slice( 1 ).toLowerCase() + '.js' ); + }, + function ( importee ) { + if ( importee[0] === '!' ) return ''; + } + ], + load: function ( id ) { + if ( id === '' ) return ''; + } + }, + exports: function ( exports ) { + assert.strictEqual( exports.res, 0 ); + } +}; diff --git a/test/function/custom-path-resolver-plural/globals-math.js b/test/function/custom-path-resolver-plural/globals-math.js new file mode 100644 index 0000000..daa4e39 --- /dev/null +++ b/test/function/custom-path-resolver-plural/globals-math.js @@ -0,0 +1,2 @@ +export var sin = Math.sin; +export var cos = Math.cos; diff --git a/test/function/custom-path-resolver-plural/main.js b/test/function/custom-path-resolver-plural/main.js new file mode 100644 index 0000000..70511f5 --- /dev/null +++ b/test/function/custom-path-resolver-plural/main.js @@ -0,0 +1,4 @@ +import { sin } from '@Math'; +import '!path'; + +export var res = sin( 0 );