{"action":"created","issue":{"url":"https://api.github.com/repos/chaijs/chai/issues/572","labels_url":"https://api.github.com/repos/chaijs/chai/issues/572/labels{/name}","comments_url":"https://api.github.com/repos/chaijs/chai/issues/572/comments","events_url":"https://api.github.com/repos/chaijs/chai/issues/572/events","html_url":"https://github.com/chaijs/chai/issues/572","id":122762316,"number":572,"title":"should.have.deep.members diff","user":{"login":"qbolec","id":133093,"avatar_url":"https://avatars.githubusercontent.com/u/133093?v=3","gravatar_id":"","url":"https://api.github.com/users/qbolec","html_url":"https://github.com/qbolec","followers_url":"https://api.github.com/users/qbolec/followers","following_url":"https://api.github.com/users/qbolec/following{/other_user}","gists_url":"https://api.github.com/users/qbolec/gists{/gist_id}","starred_url":"https://api.github.com/users/qbolec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbolec/subscriptions","organizations_url":"https://api.github.com/users/qbolec/orgs","repos_url":"https://api.github.com/users/qbolec/repos","events_url":"https://api.github.com/users/qbolec/events{/privacy}","received_events_url":"https://api.github.com/users/qbolec/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chaijs/chai/labels/easy-fix","name":"easy-fix","color":"bfe5bf"},{"url":"https://api.github.com/repos/chaijs/chai/labels/pull-request-wanted","name":"pull-request-wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-17T15:50:44Z","updated_at":"2015-12-18T14:37:47Z","closed_at":null,"body":"I'm new to mocha and chai, so I'm not sure if my issue should be filed against one or the other.\r\nThe problem is that I often need to check if two arrays contain same elements up to permutation.\r\nI use `A.should.have.deep.members(B)` for that.\r\nHere are my issues:\r\n1. I'm not sure if this particular combination of `have`, `deep` and `members` is even \"official\". The documentation at http://chaijs.com/api/bdd/ for `members` does not present this particular combo, but I guess, it's ok?\r\n2. the `mocha -R spec` reporter does not show the diff for this assertions, when they fail. Instead, I get rather not helpful `AssertionError: expected [ Array(3) ] to have the same members as [ Array(2) ]`. \r\nWhat would I expect? Something similar to A.sort().should.deep.equal(B.sort()). That is, I'd like to see '-' for each additional member, and '+' for each missing.\r\n3. if this is out of scope of chai project, and should be solved by the mocha test runner, or one of it's reporters, could you please help me, by pointing me in the right direction. Is there a way I could fix this myself?"},"comment":{"url":"https://api.github.com/repos/chaijs/chai/issues/comments/165792097","html_url":"https://github.com/chaijs/chai/issues/572#issuecomment-165792097","issue_url":"https://api.github.com/repos/chaijs/chai/issues/572","id":165792097,"user":{"login":"lucasfcosta","id":6868147,"avatar_url":"https://avatars.githubusercontent.com/u/6868147?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasfcosta","html_url":"https://github.com/lucasfcosta","followers_url":"https://api.github.com/users/lucasfcosta/followers","following_url":"https://api.github.com/users/lucasfcosta/following{/other_user}","gists_url":"https://api.github.com/users/lucasfcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasfcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasfcosta/subscriptions","organizations_url":"https://api.github.com/users/lucasfcosta/orgs","repos_url":"https://api.github.com/users/lucasfcosta/repos","events_url":"https://api.github.com/users/lucasfcosta/events{/privacy}","received_events_url":"https://api.github.com/users/lucasfcosta/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T14:37:47Z","updated_at":"2015-12-18T14:37:47Z","body":"I've also ran into this problem when creating tests for #515, I was using a try/catch to test the `err.showDiff` property, I think it would be nice to have `err()` to accept a callback so we can test the error thrown."}}