This repository was archived by the owner on Jan 31, 2023. It is now read-only.
Include Definitions for Module Exports in index.d.ts #143
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #91
This change describes the exports from
index.jsinindex.d.ts, so that TypeScript can properly resolveimportstatements for the module. It also includes running the format command on theindex.d.tsfile.Details
I was seeing the "File 'node_modules/@cypress/skip-test/index.d.ts' is not a module." error when trying to add
to a test file in my project that was written using TypeScript. By modifying
index.d.tswith the changes in this PR, I was able to resolve the error.Test file in
cypress/integration/sample_spec.ts:Test output:

My Cypress
tsconfig.json:{ "compilerOptions": { "target": "es5", "lib": ["es5", "dom"], "types": ["cypress"], }, "include": [ "**/*.ts" ] }My project's root
tsconfig.json:{ "compilerOptions": { "target": "es2019", "lib": ["es2019", "dom"], "module": "commonjs", "skipLibCheck": true, }, "include": [ "**/*.ts" ], }