alexa / ask-toolkit-for-vscode

ASK Toolkit is an extension for Visual Studio Code (VSC) that that makes it easier for developers to develop and deploy Alexa Skills.
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html
Apache License 2.0
107 stars 52 forks source link

fix: add framework for less frictional unit testing in ACDL language server, backfill hover tests #256

Closed tydonelson closed 1 year ago

tydonelson commented 1 year ago

This update introduces some utilities in acdlTestUtils.ts that offer an easier way to write unit tests for the ACDL language server. ACDL test files can be added to the test/acdlServer/mockACDL/skill-package/conversations directory, and rapid tests can be written against those files. All you need to give the utility is the name of a test ACDL file and a snippet of unique text within that ACDL file to indicate the position of the user's cursor. It will dig up what the current hover behavior is at that location and compare it with what the expected hover text is.

The utilities will be expanded in the future to cover autocomplete suggestions and getDefinition requests.

Motivation and Context

Writing a large amount of useful tests for the language server is tedious, this aims to reduce that tedium and get valuable tests more quickly.

Testing

Manual as well as unit tests, all passing.

image

Screenshots (if appropriate)

Types of changes

Checklist

License