{"action":"opened","issue":{"url":"https://api.github.com/repos/shouldjs/should.js/issues/129","repository_url":"https://api.github.com/repos/shouldjs/should.js","labels_url":"https://api.github.com/repos/shouldjs/should.js/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/shouldjs/should.js/issues/129/comments","events_url":"https://api.github.com/repos/shouldjs/should.js/issues/129/events","html_url":"https://github.com/shouldjs/should.js/issues/129","id":196013087,"number":129,"title":"odd results with .should.be.fulfilled()","user":{"login":"jmls","id":929523,"avatar_url":"https://avatars.githubusercontent.com/u/929523?v=3","gravatar_id":"","url":"https://api.github.com/users/jmls","html_url":"https://github.com/jmls","followers_url":"https://api.github.com/users/jmls/followers","following_url":"https://api.github.com/users/jmls/following{/other_user}","gists_url":"https://api.github.com/users/jmls/gists{/gist_id}","starred_url":"https://api.github.com/users/jmls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmls/subscriptions","organizations_url":"https://api.github.com/users/jmls/orgs","repos_url":"https://api.github.com/users/jmls/repos","events_url":"https://api.github.com/users/jmls/events{/privacy}","received_events_url":"https://api.github.com/users/jmls/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-16T09:16:29Z","updated_at":"2016-12-16T09:16:29Z","closed_at":null,"body":"I'm not sure what is happening here. I have a method that returns a promise (which, at the moment *always* rejects the login)\r\n\r\n```\r\n        /**\r\n         * login a user and get a sessionId\r\n         * @param {string} username The user name\r\n         * @param {string} password The user password\r\n         * @param {function} [callback] The callback function\r\n         */\r\n        login(username: string, password:string, callback:Function) {\r\n            debug(\"login not implemented\");\r\n\r\n            return new Promise((resolve,reject) => {\r\n                return callback ? callback(null,{}) : reject(\"invalid username or password\");\r\n            });\r\n        };\r\n```\r\n\r\nand this is my test\r\n\r\n```\r\nit('should fail with invalid username',  (done) => {\r\n  sessionModel.login(\"bar\",\"foo\").should.be.rejected();\r\n  done();\r\n});\r\n\r\nit('should pass with a user name of \"foo\" and a password of \"bar\"',  (done) => {\r\n  sessionModel.login(\"foo\",\"bar\").should.be.fulfilled();\r\n  done();\r\n});\r\n```\r\n\r\nthe \"invalid username\" test passes, *and so does the valid username* : even though there are errors pn the screen\r\n\r\n![image](https://cloud.githubusercontent.com/assets/929523/21257397/e7b0be10-c36f-11e6-96c0-2a5279f01608.png)\r\n\r\n## Node.js version? : 7.0.0 / 7.2.0 / 4.6.1**\r\n\r\n** 4.6.1 does not show the errors on the console, but still passes the test\r\n\r\n## Should.js version? : 11.1.2\r\n\r\n\r\n"}}
{"actor":{"display_login":"jmls"}}