In addition to being unable to declare the same block-scoped variable in multiple files (e.g. the commands file and a spec file, or multiple spec files), I am also unable to declare two functions with the same name.
For example, this shows a compilation error that occurs from defining the same function in both commands.ts and a spec file:
It seems like TypeScript is treating my spec files and command file as scripts with shared scope, as described here. This behavior prevents me from migrating our Cypress tests to TypeScript.
Related: this comment.
In addition to being unable to declare the same block-scoped variable in multiple files (e.g. the commands file and a spec file, or multiple spec files), I am also unable to declare two functions with the same name.
For example, this shows a compilation error that occurs from defining the same function in both
commands.ts
and a spec file:It seems like TypeScript is treating my spec files and command file as scripts with shared scope, as described here. This behavior prevents me from migrating our Cypress tests to TypeScript.