Closed TalAter closed 8 years ago
Another fantastic issue, going to post this on the @yourfirstpr twitter account tomorrow!
Thank you @Charlotteis :blush:
I'd be happy to take a look at this. :)
I'm just wondering whether there's a particular reason why "the" is repeated in the test spec outlined here? I notice it's the case for all of the test specs beginning "should call the callback with" in BasicSpec.js.
Thanks @ZahraTee, I'm looking forward to your contribution.
Regarding the 'the', that was just a typo. I'm pushing a fix for that now. Nicely spotted :eyes:
Closed in PR #171
Code looks great @ZahraTee.
Thank you for the help, and I hope it is the first of many :octocat: contributions to open source!
P.S. - When submitting pull requests, some project maintainers would ask you to submit your work as a single commit. In the future, you can squash multiple commits like the 2 you had in this pull request into a single commit before sending the pull request. Check out this handy tutorial by @kentcdodds on how to do this - https://egghead.io/lessons/javascript-how-to-squash-multiple-git-commits?series=how-to-contribute-to-an-open-source-project-on-github
Thanks again :+1:
first-timers-only
This issue is tagged :octocat: 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.
Thank you for your help :heart:
Background
Callbacks added using
annyang.addCallback('result', aFunction)
will be called after any speech is detected, whether a command was matched or not (see docs).The callback function should be called with an array of the possible sentences the user may have said as the first argument.
The Issue
The test specs do not currently test to verify that the callback function is called with the possible sentences the user may have said
Add a test spec that verify this spec:
This should be added into the following test suite:
The last test described inside
describe("annyang.addCallback('resultNoMatch')", function() {…});
in test/spec/BasicSpec.js, can be used as a template for adding the new spec described above.Contributing to annyang
$ git clone git@github.com:YOUR-GITHUB-USER-NAME/annyang.git
$ cd annyang; npm install
$ grunt
$ 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:$ grunt
. This makes sure everything works, and all files are kept up to date with your changes.$ git push -u origin master
About the tests
annyang is tested using Jasmine.
BasicSpec.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() {})
).To simulate Speech Recognition in the testing environment, annyang uses a mock object called 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
).