expect
expect copied to clipboard
Write better assertions
```js expect(() => foo()).toNotThrow ``` fails when `foo` throws, but it doesn't tell me what error `foo` threw. This would be really useful for debugging. I'm happy to make a...
I was glad to see that expect works with custom messages, but had to look at the code to see exactly how and when they are fired, and how I...
First, great project! I'm sure you saw my tweet of praise: > https://twitter.com/ericclemmons/status/681615901343399936 ### `toHaveBeenCalledWith` Anyway, having replaced `sinon` with this, I've noticed that this very readable call... ``` js...
Example: ``` js it('toInclude should work for Maps', () => { const obj = { a: 'a', b: 'b', c: 'c' }; const map = new Map(); Object.keys(obj).forEach(k => {...
```js > expect(Object.create(null)).toEqual({}) Error: Expected {} to equal {} ``` They are different, because of prototype, but the output is weird.
I'm getting what appears to be a bogus error: ``` Expected { app: { data: {}, ui: { fetchinUser: false, fetchingInstruments: false, fetchingLoans: false, modalOpen: false, modalView: null, selectedTab: 0,...
The meaning of `spy.reset` is ambiguous (see discussion in #138). What exactly does it reset? The call count? The return/thrown values? My vote is to either remove it or make...
I'm trying out migrating from `mocha` & `expect` to just `jest`. The code mods handled most of the cases, but there are some MAJOR differences in how Jest's `isEqual` matcher...
Is there a way to do something like this: ``` javascript expect(mySpy).toHaveBeenCalledWith('foo', 'bar', anythingOfType(Function)); ``` Seems like we would have to modify the `isEqual` test helper.
Hey, thanks for this great library. I just came across `.toExcludeKeys`. And for me it feels that something is wrong here. The docs say: > does not contain **any** of...