When setting the compilerOption esModuleInterop to true
Issue
Example test:
import percySnapshot from '@percy/testcafe';
fixture('Session').page('http://localhost:8080');
test('Session: Visual Regression', async (target) => {
await percySnapshot(target, 'Session: Welcome');
});
(ignore type error with percySnapshot, covered in #108)
Gives me an error of:
1) TypeError: testcafe_1.default is not a function
Browser: Chrome 90.0.4430.212 / macOS 10.15.7
8 |
9 |import percySnapshot from '@percy/testcafe';
10 |fixture('Session').page('http://localhost:8080');
11 |
12 |test('Session: Visual Regression', async target => {
> 13 | await percySnapshot(target, 'Session: Welcome');
14 |});
15 |
Workaround
import * as percySnapshot from '@percy/testcafe';
fixture('Session').page('http://localhost:8080');
test('Session: Visual Regression', async target => {
await (percySnapshot as any)(target, 'Session: Welcome');
});
(replace the any with the type when fixed)
Futher Reading
DevExpress/testcafe#3983
https://stackoverflow.com/questions/56238356/understanding-esmoduleinterop-in-tsconfig-file
When setting the
compilerOptionesModuleInterop totrueIssue
Example test:
(ignore type error with percySnapshot, covered in #108)
Gives me an error of:
Workaround
(replace the
anywith the type when fixed)Futher Reading
DevExpress/testcafe#3983
https://stackoverflow.com/questions/56238356/understanding-esmoduleinterop-in-tsconfig-file