kiwigrid/gherkin-testcafe

Unable to use import statements in step files

Closed this issue · 3 comments

gherkin-tescafe could run those internally through Babel?

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.

Yes. I know. It would just be much more convenient if it was handled internally, just like TestCafe does.

This is very true. But with the issue mentioned above, there is a plan to implement a transpilation step before running the steps.