Skip to content

Commit

Permalink
update(docs): change node polyfill for cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
elaichenkov authored Sep 27, 2023
1 parent 5137abc commit 7cd1aa1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ Additionally, you may need to install and add node polyfill in your `support/e2e
1. Install the polyfill module:

```bash
npm i -D @esbuild-plugins/node-modules-polyfill
npm i -D esbuild-plugin-polyfill-node
```
2. Import the following code in your `support/e2e.js` file:

```js
const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill');
const { polyfillNode } = require('esbuild-plugin-polyfill-node');
```

3. Add the following code in your `plugins` property:
Expand All @@ -64,14 +64,12 @@ module.exports = defineConfig({
e2e: {
async setupNodeEvents(on, config) {
const bundler = createBundler({
// add polyfill ⬇ NodeModulesPolyfillPlugin
plugins: [NodeModulesPolyfillPlugin(), createEsbuildPlugin(config)],
plugins: [polyfillNode({ polyfills: { crypto: true } }), createEsbuildPlugin(config)],
});
}
}
});
```
Moreover, you can take a look at the [comment](https://github.com/elaichenkov/cy-verify-downloads/issues/51#issuecomment-1237978973) with detailed example of adding node polyfill in your config.

**For Cypress v9:**

Expand Down

0 comments on commit 7cd1aa1

Please sign in to comment.