An Alexa skill for the FIFA Worldcup
With this skill, you can ask informations abot FIFA Worldcup 2018.
In the AWS Lambda page you will find events tests. Every function in your lambda HAVE TO be tested this way. It enables developers to :
To unit test, there is some libraries:
Run the command mocha
in your terminal. It will run every test available in the /test
directory.
Simple unit tests sample
In this sample, we test the dataExtractor functions.
First, we have a test description. For this description, we add multiple tests in the it
section. Then, we assert in the callback with chai.
describe( 'nextMatch', function() {
it( `nextMatch Error`, function() {
return LambdaTester( myLambda.handler )
.event(nextMatchMock)
.expectResult( ( result ) => {
console.log(result);
expect( result.response.outputSpeech.ssml).to.equal(
"<speak>Le prochain match a lieu le 21 juin à 20h00 heure locale (17H à Paris). Il s'agit de France contre Pérou</speak>"
);
});
});
});