Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/elaichenkov/cypress-diff

cypress-diff makes your life easier to find out why your tests are failing
https://github.com/elaichenkov/cypress-diff

cypress cypress-io e2e reporter testing tools

Last synced: 13 days ago
JSON representation

cypress-diff makes your life easier to find out why your tests are failing

Awesome Lists containing this project

README

        

# cypress-diff

[![npm](https://img.shields.io/npm/dt/cypress-diff)](https://www.npmjs.com/package/cypress-diff)

![cypress-diff](assets/cypress-diff.png)

> Keep in mind that it's still in beta. Please, report any issues you find. Moreover, this library is designed to work with texts and objects.

## Installation

```bash
npm i -D cypress-diff
```

## Usage

Add the following line to your `cypress/support/e2e.js` file:

### JavaScript

```js
// cypress/support/e2e.js
require('cypress-diff');
```

### TypeScript

```ts
// cypress/support/e2e.ts
import 'cypress-diff';
```

## Configuration (optional)

In case you are using a `Cypress.on('fail')` handler in your tests already then you can configure the plugin like this:

```js
// cypress/support/e2e.js
const { onFailHandler } = require('cypress-diff');

Cypress.on('fail', (error, runnable) => {
// ...
onFailHandler(error, runnable);
// ...
});
```

## License

[MIT](LICENSE)

### Author

Yevhen Laichenkov