{"action":"created","issue":{"url":"https://api.github.com/repos/TalAter/annyang/issues/152","labels_url":"https://api.github.com/repos/TalAter/annyang/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/TalAter/annyang/issues/152/comments","events_url":"https://api.github.com/repos/TalAter/annyang/issues/152/events","html_url":"https://github.com/TalAter/annyang/issues/152","id":128314787,"number":152,"title":"first-timers-only: Add test to make sure resultNoMatch isn't called when command matched","user":{"login":"TalAter","id":926653,"avatar_url":"https://avatars.githubusercontent.com/u/926653?v=3","gravatar_id":"","url":"https://api.github.com/users/TalAter","html_url":"https://github.com/TalAter","followers_url":"https://api.github.com/users/TalAter/followers","following_url":"https://api.github.com/users/TalAter/following{/other_user}","gists_url":"https://api.github.com/users/TalAter/gists{/gist_id}","starred_url":"https://api.github.com/users/TalAter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TalAter/subscriptions","organizations_url":"https://api.github.com/users/TalAter/orgs","repos_url":"https://api.github.com/users/TalAter/repos","events_url":"https://api.github.com/users/TalAter/events{/privacy}","received_events_url":"https://api.github.com/users/TalAter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TalAter/annyang/labels/first-timers-only","name":"first-timers-only","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-23T08:46:55Z","updated_at":"2016-01-23T15:19:23Z","closed_at":"2016-01-23T14:40:38Z","body":"#### first-timers-only\r\n\r\nThis issue is tagged **first-timers-only**. It is only for people who have never contributed to open source before, and are looking for an easy way take their first steps.\r\n\r\nThank you for your help :heart:\r\n\r\n#### The Issue\r\n\r\n- Callbacks added using `annyang.addCallback('resultNoMatch', aFunction)` will be called when a sentence a user said doesn't match any of the currently registered commands.\r\n- Callbacks added using `annyang.addCallback('resultMatch', aFunction)` will be called when a sentence a user said does match any of the currently registered commands.\r\n- Callbacks added using `annyang.addCallback('result', aFunction)` will be called when a user has said something whether it matches any of the currently registered commands or not.\r\n\r\nThe test specs do not currently test to make sure `'resultNoMatch'` callbacks don't get called when a match is found.\r\n\r\nThe tests described inside `describe(\"annyang.addCallback('resultNoMatch')\", function() {…});` in *test/spec/BasicSpec.js* include a test to make sure it is called when there is no match, and should be used as a template for creating a test for what happens when there is a match.\r\n\r\nAdd a test that verifies this condition:\r\n````javascript\r\nit('should add a callback which will not be called when result returned from Speech Recognition matches a command')\r\n````\r\n\r\n#### Contributing to annyang\r\n\r\n- [x] Fork the repository from the [annyang GitHub page](https://github.com/TalAter/annyang).\r\n- [x] Clone a copy to your local machine with `$ git clone git@github.com:YOUR-GITHUB-USER-NAME/annyang.git`\r\n- [x] Make sure you have *node.js* and *npm* installed on your machine. You can use this [guide](https://docs.npmjs.com/getting-started/installing-node) for help.\r\n- [x] Install all of annyang's development dependencies with npm. `$ cd annyang; npm install`\r\n- [x] Run grunt to make sure everything runs smoothly `$ grunt`\r\n- [x] Code, code, code.\r\n- [x] Run `$ grunt` after making changes to verify that everything still works and run the build process. Alternatively, you can just run `$ grunt watch` once, and leave that process running. It will continuously run all the tests and build the files every time you make a change to one of annyang's files. It will even *beep* if you make an error, and help you debug it.:+1:\r\n- [x] Before committing your changes, the last step must always be running `$ grunt`. This makes sure everything works, and all files are kept up to date with your changes.\r\n- [x] Once you've made sure all your changes work correctly, and committed all your changes, push your local changes back to github with `$ git push -u origin master`\r\n- [x] Visit your fork on GitHub.com ([https://github.com/YOUR-USER-NAME/annyang](https://github.com/YOUR-USER-NAME/annyang)) and create a pull request for your changes.\r\n- [x] Makes sure your pull request describes exactly what you changed and references this issue (just include the issue number in the title like this: #49)\r\n\r\n#### About the tests\r\n\r\nannyang is tested using [Jasmine](http://jasmine.github.io/2.0/introduction.html).\r\n\r\nBasicSpec.js contains a series of spec groups (e.g. `describe('a spec group', function() {})`) which each contain 1 or more specs (e.g. `it('should do stuff', function() {})`). Some of the spec groups also contain some code which runs before each spec (`beforeEach(function() {})`).\r\n\r\nTo simulate Speech Recognition in the testing environment, annyang uses a mock object called [Corti](https://github.com/TalAter/Corti) which mocks the browser's SpeechRecognition object. Corti also adds a number of utility functions to the SpeechRecognition object which simulate user actions (e.g. `say('Hello there')`), and allow checking the SpeechRecognition's status (e.g. `isListening() === true`).\r\n"},"comment":{"url":"https://api.github.com/repos/TalAter/annyang/issues/comments/174193163","html_url":"https://github.com/TalAter/annyang/issues/152#issuecomment-174193163","issue_url":"https://api.github.com/repos/TalAter/annyang/issues/152","id":174193163,"user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T15:19:23Z","updated_at":"2016-01-23T15:19:23Z","body":"Perfect `first-timers-only` issue! Thanks for doing this for the community :-D"}}