Any plans for DefinitelyTyped support?
See original GitHub issueIs your feature request related to a problem? Please describe.
I was following the Cypress Full Stack Code Coverage guide and wanted to instrument my express back end by doing the following in my index.ts
file:
import express from "express";
import cypressCodeCoverage from "@cypress/code-coverage/middleware/express";
const app = express();
cypressCodeCoverage(app);
I get the “Try npm install @types/cypress__code-coverage
if it exists or add a new declaration (.d.ts) file containing declare module '@cypress/code-coverage/middleware/express';
” error. When I tried to install the DefinitelyTyped module, I realized one does not exist for @types/cypress__code-coverage
.
Describe the solution you’d like
Either a new package in the DefinitelyTyped repo for @types/cypress_code-coverage
, or for the package itself to natively support typescript for back end instrumentation.
Describe alternatives you’ve considered I’m happy to workaround this in the mean time by adding a global type declaration file for my package. I just wanted to see if you had any plans to support this or if you’d be okay with me putting up a PR for it (and see which approach you preferred)!
Additional context Let me know if you need anything else!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top GitHub Comments
@nicholaschiang this was deprioritized on my end as I moved away from the project that was using cypress code coverage. Doesn’t mean we can’t add to the DefinitelyTyped Repo! I’d be down to combine what I had from that project and what you have here as sort of a v1 that other people could use and grow from there
@dvargas92495 here are my current
global.d.ts
definitions (if you haven’t made some already):You can then use it in your
cypress/plugins/index.ts
like so:Note: You must first add the global
cypress
type definitions in yourtsconfig.json
to be able to reference them like that: