{"action":"opened","issue":{"url":"https://api.github.com/repos/chaijs/chai/issues/923","repository_url":"https://api.github.com/repos/chaijs/chai","labels_url":"https://api.github.com/repos/chaijs/chai/issues/923/labels{/name}","comments_url":"https://api.github.com/repos/chaijs/chai/issues/923/comments","events_url":"https://api.github.com/repos/chaijs/chai/issues/923/events","html_url":"https://github.com/chaijs/chai/issues/923","id":203906386,"number":923,"title":"Custom message not always respected","user":{"login":"meeber","id":17260989,"avatar_url":"https://avatars.githubusercontent.com/u/17260989?v=3","gravatar_id":"","url":"https://api.github.com/users/meeber","html_url":"https://github.com/meeber","followers_url":"https://api.github.com/users/meeber/followers","following_url":"https://api.github.com/users/meeber/following{/other_user}","gists_url":"https://api.github.com/users/meeber/gists{/gist_id}","starred_url":"https://api.github.com/users/meeber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meeber/subscriptions","organizations_url":"https://api.github.com/users/meeber/orgs","repos_url":"https://api.github.com/users/meeber/repos","events_url":"https://api.github.com/users/meeber/events{/privacy}","received_events_url":"https://api.github.com/users/meeber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-29T23:52:18Z","updated_at":"2017-01-29T23:52:18Z","closed_at":null,"body":"As noted [here](https://github.com/chaijs/chai/issues/904#issuecomment-275867812), there's a problem with some assertions not always respecting a custom failed assertion error message. This problem is different (and more widespread) than the flag transfer problem mentioned in #904.\r\n\r\nHere's an example:\r\n\r\n```js\r\nexpect('blah').to.be.closeTo(2, 1, 'CUSTOM');  // Correctly includes custom error message\r\nexpect('blah', 'CUSTOM').to.be.closeTo(2, 1); // Incorrectly excludes custom error message\r\n```\r\n\r\nThe culprit for the above example is [this line](https://github.com/chaijs/chai/blob/576a6f71530a158b014a97fc4bf9a152c1fbccd6/lib/chai/core/assertions.js#L1867). If the `msg` argument isn't provided, then it needs to look at the value of the `msg` flag instead.\r\n\r\nMany other occurrences of this issue are similar to the above example. Also there are some assertions that fail to pass on the `msg` at all to internal assertions or errors, but #922 coincidentally fixes those occurrences."}}
{"actor":{"display_login":"meeber"}}