Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsjonq/cyan
🐱 Cypress-like testing for React + JSDOM
https://github.com/itsjonq/cyan
cypress jsdom open-source react testing testing-library
Last synced: 3 months ago
JSON representation
🐱 Cypress-like testing for React + JSDOM
- Host: GitHub
- URL: https://github.com/itsjonq/cyan
- Owner: ItsJonQ
- License: mit
- Created: 2019-04-14T04:46:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:53:08.000Z (about 2 years ago)
- Last Synced: 2024-04-25T20:22:20.419Z (10 months ago)
- Topics: cypress, jsdom, open-source, react, testing, testing-library
- Language: JavaScript
- Homepage: https://cyan.netlify.com/
- Size: 3.34 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐱 Cyan
[](https://travis-ci.org/itsjonq/cyan)
[](https://coveralls.io/github/ItsJonQ/cyan?branch=master)
[](https://badge.fury.io/js/%40itsjonq%2Fcyan)> Cypress-like Testing for React + JSDOM
## Table of Contents
- [Installation](#installation)
- [Example](#example)
- [Documentation](#documentation)## Installation
```
npm install --save-dev @itsjonq/cyan
```## Example
```jsx
import React from 'react'
import { cy } from '@itsjonq/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)!