mjackson / mjackson/expect

whyNotEqual

Open
#153 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
JavaScript
Stars
2.3k
Forks
115
PR merge metrics
No merged PRs in 30d

Description

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, sidebarOpen: false, sidebarView: null, snackbarList: [], snackbarNextId: 0 } }, form: { search: { _active: 'query', _asyncValidating: false, _error: undefined, _initialized: false, _submitFailed: false, _submitting: false, query: { _isFieldValue: true, visited: true } } } } to equal { app: { data: {}, ui: { fetchinUser: false, fetchingInstruments: false, fetchingLoans: false, modalOpen: false, modalView: null, selectedTab: 0, sidebarOpen: false, sidebarView: null, snackbarList: [], snackbarNextId: 0 } }, form: { search: { _active: 'query', _asyncValidating: false, _initialized: false, _submitFailed: false, _submitting: false, query: { _isFieldValue: true, visited: true } } } }

It would be great is failed assertions would use whyNotEqual to report the issue:

https://www.npmjs.com/package/is-equal#want-to-know-why-two-values-are-not-equal

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failed-assertion reporting in the expect package and review the linked is-equal whyNotEqual documentation. The work is done when failed assertions explain the differing values rather than only printing the complete expected and actual objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.