I encountered a bug with testcafe-hammerhead, or more precicely, this transform:
This transform produces invalid Javascript when we have an object method of the name postMessage on a plain object, and that code is transpiled by babel (preset used:babel-preset-env) and bundled with webpack.
While the code runs well without testcafe, when accessed through testcafe running a fixture, it turns this:
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
postMessage: function postMessage(event) {
console.log('Hello!');
}
}
});
into this:
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
postMessage: function __get$PostMessage(null,postMessage)(event) {
console.log('Hello!');
}
}
});
However, this doesn't seem to happen when the code is not bundled with webpack.
https://github.com/LinusBorg/testcafe-hammerhead-postMessage-bug
The repository's README has more information and detailed instructions about how to reproduce the behaviour.
Hi @LinusBorg,
Thanks for the detailed description. I'm working on this.
Happy to help :)
Thanks for a great tool!
I'll delete my repo. If you need it again, let me know.
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.
Most helpful comment
Happy to help :)
Thanks for a great tool!