Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 7d8c9fc

Browse files
authored
fix: add note about speed (#181)
1 parent 2829077 commit 7d8c9fc

File tree

6 files changed

+28
-8
lines changed

6 files changed

+28
-8
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ You can use any [Visual Testing plugin](https://on.cypress.io/plugins#visual-tes
225225

226226
## Common problems
227227

228-
### Node Sass
228+
<details id="node-sass">
229+
<summary>Node Sass</summary>
229230

230231
When using Node Sass styles, tell Cypress to use [the system NodeJS](https://on.cypress.io/configuration#Node-version) rather than its bundled version. In `cypress.json` set option:
231232

@@ -235,6 +236,23 @@ When using Node Sass styles, tell Cypress to use [the system NodeJS](https://on.
235236
}
236237
```
237238

239+
</details>
240+
241+
<details id="speed">
242+
<summary>Slow bundling</summary>
243+
244+
When you bundle spec file, you are now bundling React, Read DOM and other libraries, which is might be slow. For now, you can disable inline source maps by adding to your Webpack config settings (if available) the following:
245+
246+
```js
247+
const webpackOptions = {
248+
devtool: false,
249+
}
250+
```
251+
252+
Keep your eye on issue [#156](https://github.com/bahmutov/cypress-react-unit-test/issues/156) for more information.
253+
254+
</details>
255+
238256
## Development
239257

240258
See [docs/development.md](./docs/development.md)

cypress/component/advanced/testing-lib-example/testing-lib-spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React from 'react'
22
import { mount } from 'cypress-react-unit-test'
33
import Fetch from './fetch'
44

5+
// https://testing-library.com/docs/cypress-testing-library/intro
6+
import '@testing-library/cypress/add-commands'
7+
58
it('loads and displays greeting (testing-lib)', () => {
69
cy.server()
710
cy.route('/greeting', { greeting: 'Hello there' }).as('greet')

cypress/plugins/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const webpackOptions = {
1010
react: path.resolve('./node_modules/react'),
1111
},
1212
},
13+
mode: 'development',
14+
devtool: false,
1315
module: {
1416
rules: [
1517
{

cypress/support/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@
1717
// using "npm run transpile"
1818
import 'cypress-react-unit-test/hooks'
1919
// import '@percy/cypress'
20-
21-
// https://testing-library.com/docs/cypress-testing-library/intro
22-
import '@testing-library/cypress/add-commands'
2320
// import 'cypress-plugin-snapshots/commands'

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
},
103103
"dependencies": {
104104
"@cypress/code-coverage": "3.7.0",
105-
"@cypress/webpack-preprocessor": "5.1.2",
105+
"@cypress/webpack-preprocessor": "5.2.0",
106106
"babel-plugin-istanbul": "6.0.0",
107107
"debug": "4.1.1",
108108
"find-webpack": "1.6.1",

0 commit comments

Comments
 (0)