Skip to content

Provide complete E2E TypeScript scaffolding #27603

Open
@MikeMcC399

Description

@MikeMcC399

What would you like?

If the npm module typescript is installed with no other TypeScript configuration files defined, Cypress E2E scaffolding should set up a minimum configuration to enable the basic E2E example to run successfully with no errors. This would include adding the file tsconfig.json to the scaffolded Folder Structure.

Why is this needed?

First-time TypeScript users should experience the same smooth set up as JavaScript users currently do when installing Cypress and using a default configuration.

Steps to reproduce

mkdir cy-ts-test
cd cy-ts-test
git init
npm init -y
npm install typescript -D
npm install cypress -D
npx cypress open --e2e --browser electron

Click "Continue"
Click "Create new spec"
Click "Create spec"
Click "Okay, run the spec"

Note the error message

Error: Webpack Compilation Error
[tsl] ERROR
      TS18002: The 'files' list in config file 'tsconfig.json' is empty.

Note that if the line npm install typescript -D in the above steps is omitted, then scaffolding and running the example spec is successful.

Related issues

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