return statements in module body are only supported in Node because its module are in fact FunctionBody nodes. These kinds of early returns are not supported in ESM. Avoiding them is an easy fix.
What
Refactor tests to call specific functions based on the role of the process, instead of using early returns in module body.
Why
return
statements in module body are only supported in Node because its module are in factFunctionBody
nodes. These kinds of early returns are not supported in ESM. Avoiding them is an easy fix.What
Refactor tests to call specific functions based on the role of the process, instead of using early returns in module body.