Browse Source

additional test for #421

gh-438-b
Rich Harris 9 years ago
parent
commit
800e0a4112
  1. 3
      test/function/call-non-function-default-exports/_config.js
  2. 9
      test/function/call-non-function-default-exports/foo.js
  3. 4
      test/function/call-non-function-default-exports/main.js

3
test/function/call-non-function-default-exports/_config.js

@ -0,0 +1,3 @@
module.exports = {
description: 'calls non-function default exports'
};

9
test/function/call-non-function-default-exports/foo.js

@ -0,0 +1,9 @@
function x () {
global.answer = 'x';
}
function y () {
global.answer = 'y';
}
export default Math.random() < 0.5 ? x : y;

4
test/function/call-non-function-default-exports/main.js

@ -0,0 +1,4 @@
import foo from './foo.js';
foo();
assert.ok( /[xy]/.test( global.answer ) );
Loading…
Cancel
Save