https://github.com/helpscout/cyan
🐱 Cyan: Cypress-like Testing for React + JSDOM
https://github.com/helpscout/cyan
cypress integration javascript jsdom library open-source react react-router redux testing
Last synced: about 1 year ago
JSON representation
🐱 Cyan: Cypress-like Testing for React + JSDOM
- Host: GitHub
- URL: https://github.com/helpscout/cyan
- Owner: helpscout
- License: mit
- Created: 2019-04-17T13:18:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T20:03:43.000Z (over 3 years ago)
- Last Synced: 2025-04-12T04:54:52.485Z (about 1 year ago)
- Topics: cypress, integration, javascript, jsdom, library, open-source, react, react-router, redux, testing
- Language: JavaScript
- Homepage: https://cyan-testing.netlify.com/
- Size: 4.24 MB
- Stars: 2
- Watchers: 8
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐱 Cyan
[](https://travis-ci.org/helpscout/cyan)
[](https://coveralls.io/github/helpscout/cyan?branch=master)
[](https://badge.fury.io/js/%40helpscout%2Fcyan)
> Cypress-like Testing for React + JSDOM
## Table of Contents
- [Installation](#installation)
- [Example](#example)
- [Documentation](#documentation)
## Installation
```
npm install --save-dev @helpscout/cyan
```
## Example
```jsx
import React from 'react'
import { cy } from '@helpscout/cyan'
import Modal from '../Modal'
cy.useFakeTimers()
test('Can open/close a Modal', () => {
cy.render(
Open}>
Content
,
)
cy.get('button').click()
expect(cy.get('.Modal').hasClass('is-open')).toBeTruthy()
expect(cy.get('.content').exists()).toBeTruthy()
cy.getByCy('CloseButton').click()
expect(cy.get('.Modal').hasClass('is-open')).toBeFalsy()
expect(cy.get('.content').exists()).toBeFalsy()
})
```
## Documentation
For additional information, check out [our documentation](https://cyan-testing.netlify.com)!