<commit_before># Alexa Skill Test Framework

This framework makes it easy to create full-coverage black box tests for an Alexa skill using [Mocha](https://mochajs.org/).

Here's an example of what a test might look like with the test framework.
``` Javascript
describe("AMAZON.HelpIntent into AMAZON.CancelIntent", function(){
  alexaTest.test([
    { request: alexaTest.getIntentRequest("AMAZON.HelpIntent"), says: alexaTest.t("HELP_MESSAGE"), shouldEndSession: false },
    { request: alexaTest.getIntentRequest("AMAZON.CancelIntent"), says: alexaTest.t("STOP_MESSAGE"), shouldEndSession: true }
  ]);
});
```

## How To
Install the package as a dev dependency with `npm install alexa-skill-test-framework --save-dev`.

Write tests in a Javascript file and run them with Mocha. For example, if your test is at 'test/index.js', run `mocha test/index.js`.

For some simple examples, see the 'examples' directory.

## Test Framework Documentation

### alexaTest.initialize(index, version, appId, userId)
Initializes the test framework. Must be called before generating requests or running any tests.
* `index`: The object containing your skill's 'handler' method. Must define a method called `handler(event, context, callback)`, which runs the skill.
  * The test framework passes 'true' as a fourth parameter to the handler. Obviously this should be used sparingly, if at all.<commit_msg>remove version from init signature in readme<commit_after># Alexa Skill Test Framework

This framework makes it easy to create full-coverage black box tests for an Alexa skill using [Mocha](https://mochajs.org/).

Here's an example of what a test might look like with the test framework.
``` Javascript
describe("AMAZON.HelpIntent into AMAZON.CancelIntent", function(){
  alexaTest.test([
    { request: alexaTest.getIntentRequest("AMAZON.HelpIntent"), says: alexaTest.t("HELP_MESSAGE"), shouldEndSession: false },
    { request: alexaTest.getIntentRequest("AMAZON.CancelIntent"), says: alexaTest.t("STOP_MESSAGE"), shouldEndSession: true }
  ]);
});
```

## How To
Install the package as a dev dependency with `npm install alexa-skill-test-framework --save-dev`.

Write tests in a Javascript file and run them with Mocha. For example, if your test is at 'test/index.js', run `mocha test/index.js`.

For some simple examples, see the 'examples' directory.

## Test Framework Documentation

### alexaTest.initialize(index, appId, userId)
Initializes the test framework. Must be called before generating requests or running any tests.
* `index`: The object containing your skill's 'handler' method. Must define a method called `handler(event, context, callback)`, which runs the skill.
  * The test framework passes 'true' as a fourth parameter to the handler. Obviously this should be used sparingly, if at all.
{'fraction_non_alphanumeric': 0.09971408148677627, 'fraction_numerical': 0.0, 'mean_word_length': 5.006437768240343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2029413', 'n_tokens_mistral': 815, 'n_tokens_neox': 770, 'n_words': 324}