Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 6 days ago
JSON representation

🐱 Cypress-like testing for React + JSDOM

Awesome Lists containing this project

README

        

# 🐱 Cyan

[![Build Status](https://travis-ci.org/itsjonq/cyan.svg?branch=master)](https://travis-ci.org/itsjonq/cyan)
[![Coverage Status](https://coveralls.io/repos/github/ItsJonQ/cyan/badge.svg?branch=master)](https://coveralls.io/github/ItsJonQ/cyan?branch=master)
[![npm version](https://badge.fury.io/js/%40itsjonq%2Fcyan.svg)](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)!