i have this setup
file1.js:
export function foo1() { ... }; file2.js:
export function foo2() { ... } hook.js:
import {foo1} from './file1'; import {foo2} from './file2'; export {foo1, foo2}; Now when i want to import from my hook:
app.js
import { foo1 } from '../data/hook.js'; i get this:
Error: invalid argument When calling foo1. (The function has no arguments/parameters).
Anyone know what's the problem?
UPDATE:
I also get the invalid argumentwhen importing foo1 directly from file1. Is this a Babel Problem?
My .babelrcb( i use test as environment):
"env": { "targets": { "node": "4.8.4" }, "test": { "presets": ["env"] }, } UPDATE AND SOLUTION:
It turned out the import was correct, thx for all the guys who helped me on this Q. The problem was due to a Promise inside the function foo1 which caused the import to fail:
browser.waitUntil(..); // see http://webdriver.io/api/utility/waitUntil.html
function foo1();is a syntax error. Did you meanfunction foo1() {}?