Unable to use import statements in step files
Closed this issue · 3 comments
jmullo commented
gherkin-tescafe
could run those internally through Babel?
Lukas-Kullmann commented
Could you provide more context?
Do you mean using ES6 module import statements like
import { Selector } from 'testcafe';
No, this is not possible at the moment since the test files are run on your node process without transpilation.
You can however use require
to import from modules:
const { Selector } = require('testcafe');
Please note that it also relates to #12 where @DennisJaamann suggested to compile TS files before running the tests. You could do a similar thing with babel.
jmullo commented
Yes. I know. It would just be much more convenient if it was handled internally, just like TestCafe does.
Lukas-Kullmann commented
This is very true. But with the issue mentioned above, there is a plan to implement a transpilation step before running the steps.