deliciousinsights / chai-jest-diff Goto Github PK
View Code? Open in Web Editor NEWA plugin to make Chai’s equality assertions (shallow or deep) fail with Jest-like diffs
License: MIT License
A plugin to make Chai’s equality assertions (shallow or deep) fail with Jest-like diffs
License: MIT License
The current usage example in github and npm, for the latest version v1.0.2, is:
const chai = require('chai')
const chaiJestDiff = require('chai-jest-diff')
chai.use(chaiJestDiff())
This code does not work and it throws:
● Test suite failed to run
TypeError: _get__(...) is not a function
3 | const chaiJestDiff = require('chai-jest-diff');
4 |
> 5 | chai.use(chaiJestDiff());
| ^
6 | const { expect } = chai;
When using es module import
in my code, this works:
import chai from 'chai';
import chaiJestDiff from 'chai-jest-diff';
const { expect } = chai;
chai.use(chaiJestDiff());
However, when using require
like in the example in the readme, I need to do this:
const chai = require('chai');
const chaiJestDiff = require('chai-jest-diff');
chai.use(chaiJestDiff.default());
const { expect } = chai;
If nothing else, can the README please be updated so that others know how to use this module?
Love this package - have been looking for this! Makes chai + jest much much better.
Currently the peer dependency is set to ^20.0.4
which therefore errors if you run the latest version of jest 21.2.1
. Please can you update the peer dependency to remove this warning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.