Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ You can use any [Visual Testing plugin](https://on.cypress.io/plugins#visual-tes

## Common problems

### Node Sass
<details id="node-sass">
<summary>Node Sass</summary>

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:

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

</details>

<details id="speed">
<summary>Slow bundling</summary>

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:

```js
const webpackOptions = {
devtool: false,
}
```

Keep your eye on issue [#156](https://github.com/bahmutov/cypress-react-unit-test/issues/156) for more information.

</details>

## Development

See [docs/development.md](./docs/development.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React from 'react'
import { mount } from 'cypress-react-unit-test'
import Fetch from './fetch'

// https://testing-library.com/docs/cypress-testing-library/intro
import '@testing-library/cypress/add-commands'

it('loads and displays greeting (testing-lib)', () => {
cy.server()
cy.route('/greeting', { greeting: 'Hello there' }).as('greet')
Expand Down
2 changes: 2 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const webpackOptions = {
react: path.resolve('./node_modules/react'),
},
},
mode: 'development',
devtool: false,
module: {
rules: [
{
Expand Down
3 changes: 0 additions & 3 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@
// using "npm run transpile"
import 'cypress-react-unit-test/hooks'
// import '@percy/cypress'

// https://testing-library.com/docs/cypress-testing-library/intro
import '@testing-library/cypress/add-commands'
// import 'cypress-plugin-snapshots/commands'
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
},
"dependencies": {
"@cypress/code-coverage": "3.7.0",
"@cypress/webpack-preprocessor": "5.1.2",
"@cypress/webpack-preprocessor": "5.2.0",
"babel-plugin-istanbul": "6.0.0",
"debug": "4.1.1",
"find-webpack": "1.6.1",
Expand Down