Skip to content

Latest commit

 

History

History
 
 

webpack-options

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

example: webpack-options

The Webpack preprocessor in cypress/plugins/index.js adds the Babel React preset to the list of default Webpack plugins. This allows Cypress to transpile JSX code in cypress/component/Test.cy-spec.js file.

Note: run npm install in this folder to symlink cypress-react-unit-test dependency.

npm run cy:open
# or run headless tests
npm test
import React from 'react'
import { mount } from 'cypress-react-unit-test'
describe('components', () => {
  it('works', () => {
    mount(<div>Text</div>)
    cy.contains('Text')
  })
})

Test screenshot

More tests are in the cypress/component folder.