You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a codeceptjs project where I use typescript. If I want to use the ApiDataFactory helper and create a factory file like
exportdefaultnewFactory().attr('test','test')
I would expect that the ApiDataFactory helper is working. But as this ES6 Module export results in an object of {default: factoryObject } and the helper expects a direct factory object from importing the factory file, it cannot handle the ES6 Module exports. Returns an error:
Couldn't load factory file from /Users/dwentland/projects/dd-e2e-test-automation/dd-e2e-tests-ts/factories/user.ts, check that
"factories": {
"account": {
"factory": "./path/to/factory"
points to valid factory file.
Factory file should export an object with build method.
Current file error: Assignment to constant variable.
I am not that deep into typescript right now, but is this behavior intended? Or do I miss any configuration to get the ES6 export to run with the helper? Or do I have to use the commonjs exports in my typescript files?
Actually it would be possible to check in the ApiDataFactory.js if the builder variable has a default property make it handle the commonjs and es6 module exports.
What are you trying to achieve?
I have a codeceptjs project where I use typescript. If I want to use the ApiDataFactory helper and create a factory file like
I would expect that the ApiDataFactory helper is working. But as this ES6 Module export results in an object of
{default: factoryObject }
and the helper expects a direct factory object from importing the factory file, it cannot handle the ES6 Module exports. Returns an error:I am not that deep into typescript right now, but is this behavior intended? Or do I miss any configuration to get the ES6 export to run with the helper? Or do I have to use the commonjs exports in my typescript files?
Actually it would be possible to check in the ApiDataFactory.js if the builder variable has a default property make it handle the commonjs and es6 module exports.
What do you get instead?
I would expect the helper to create the data.
Details
The text was updated successfully, but these errors were encountered: