fix: Resolve types and dist issues with @cypress/puppeteer (#28424)

This commit is contained in:
Chris Breiding
2023-11-29 14:05:14 -05:00
committed by GitHub
parent eb9fa1b9d9
commit 72225db033
6 changed files with 9 additions and 8 deletions

View File

@@ -3,4 +3,4 @@
### Features
* Add @cypress/puppeteer plugin ([#28370](https://github.com/cypress-io/cypress/issues/28370)) ([b34d145](https://github.com/cypress-io/cypress/commit/b34d14571689a9b36efc707a3a48f27edcb98113))
* Initial release ([#28370](https://github.com/cypress-io/cypress/issues/28370)) ([b34d145](https://github.com/cypress-io/cypress/commit/b34d14571689a9b36efc707a3a48f27edcb98113))

View File

@@ -35,7 +35,7 @@ Add the following in `tsconfig.json`:
```json
{
"compilerOptions": {
"types": ["cypress", "@cypress/puppeteer"]
"types": ["cypress", "@cypress/puppeteer/support"]
}
}
```
@@ -55,7 +55,7 @@ While the `cy.puppeteer()` command is executed in the browser, the majority of t
In your Cypress config (e.g. `cypress.config.ts`):
```typescript
import { setup } from '@cypress/puppeteer/plugin'
import { setup } from '@cypress/puppeteer'
export default defineConfig({
e2e: {
@@ -76,7 +76,7 @@ export default defineConfig({
In your support file (e.g. `cypress/support/e2e.ts`):
```typescript
import { setup } from '@cypress/puppeteer/support'
import '@cypress/puppeteer/support'
```
In your spec (e.g. `spec.cy.ts`):

View File

@@ -37,9 +37,9 @@
},
"files": [
"dist",
"index.d.ts"
"support"
],
"types": "index.d.ts",
"types": "dist/plugin/index.d.ts",
"license": "MIT",
"repository": {
"type": "git",

View File

@@ -0,0 +1 @@
require('../dist/support')

View File

@@ -14,11 +14,11 @@
"strictNullChecks": true,
"target": "ES2020",
"types": [
"cypress"
"cypress",
"./support"
]
},
"include": [
"index.d.ts",
"src/"
]
}