Skip to content

Vanilla JS specs won't pass type checking in Cypress #11

Open
@eric-burel

Description

@eric-burel

In Cypress, if you run vulcan-next-starter/basic.spec.ts, everything is fine.
But if you run vulcan-next-starter/basic.spec.js, (a JS file) then basic.spec.ts build will be triggered, and will fail with errors regarding mocha globals (describe etc.).

To reproduce:

  • git checkout bugfix/11-webpack-cypress-js-import && yarn && yarn run dev
  • open Cypress yarn run cypress:open
  • run spec basic.spec.ts > ok
  • run spec basic.spec.js > not ok! It acts as if TypeScript types were unknown.

image

  • If you disable typechecking in cypress/webpack.config.js, it will work fine. But it hides the underlying issue.

Currently we are forced to use transpileOnly option of ts-loader in Cypress to bypass this.

Steps to solve

  • Decide if we should keep it possible to use vanilla JS or not in Vulcan.
  • Define on which criteria we should take this decision (speed of build, complexity of Vulcan, beginner-friendliness for instance)
  • If we keep .js, have a better support for JS files within Typescript

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions