bahmutov / local-cypress

Use Cypress without global objects

Home Page:https://glebbahmutov.com/blog/local-cypress/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Idea: Provide .d.ts file of the removed types to allow e2e types to use globals

cg-roling opened this issue · comments

I'm really just wrapping my head around how this all works, so apologies if this isn't actually possible.

My understanding is that local-cypress:

  1. Patches the Cypress package to comment out global type declarations
  2. Provides those fomerly-global types to be imported into tests

In our Angular project, we have lots and lots of e2e tests that work just fine with the global types.

We're just starting to get into component tests, and would like to put the side-by-side with the components themselves, so local-cypress seems necessary to get around type conflicts with our Jasmine tests.

If local-cypress provided a .d.ts file with the global types it removed from Cypress, I believe I could reference that in my Cypress directory to allow the e2e tests to have global types, while using local types for the component tests.

Currently I'm working around doing exactly this by creating a .d.ts file locally with all of the removed types, but it would be nice if that were done internally in local-cypress, so that it can't get out of sync.

Thoughts? Maybe there's an easy way to do all of this and I'm making way too much work out of it?