Browse Source

Add another test case.

gh-669
fatfisz 9 years ago
parent
commit
9ed87addbb
  1. 22
      test/function/relative-external-include-once-two-external/_config.js
  2. 0
      test/function/relative-external-include-once-two-external/first/foo.js
  3. 3
      test/function/relative-external-include-once-two-external/first/module.js
  4. 0
      test/function/relative-external-include-once-two-external/foo.js
  5. 4
      test/function/relative-external-include-once-two-external/main.js

22
test/function/relative-external-include-once-two-external/_config.js

@ -0,0 +1,22 @@
var assert = require( 'assert' );
var path = require( 'path' );
module.exports = {
description: 'includes a relative external module only once (two external deps)',
options: {
external: [
path.join( __dirname, './foo.js' ),
path.join( __dirname, './first/foo.js' )
]
},
context: {
require: function ( required ) {
assert( [ './foo.js', './first/foo.js' ].indexOf(required) !== -1, 'required wrong module' );
return required === './foo.js' ? 'a' : 'b';
}
},
exports: function ( exports ) {
assert( exports === 'ab' || exports === 'ba', 'two different modules should be required' );
}
};

0
test/function/relative-external-include-once-two-external/first/foo.js

3
test/function/relative-external-include-once-two-external/first/module.js

@ -0,0 +1,3 @@
import foo from './foo';
export default foo;

0
test/function/relative-external-include-once-two-external/foo.js

4
test/function/relative-external-include-once-two-external/main.js

@ -0,0 +1,4 @@
import foo from './foo';
import first from './first/module';
export default foo + first;
Loading…
Cancel
Save