Skip to content

Refactor cleanup tests #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: package-refactor-dev
Choose a base branch
from

Conversation

harrisonhjones
Copy link
Contributor

Note: This code change assumes the Add metadata to customskill handlers commit is going to be pulled in from #36. Sorry for the noise from that commit.

A few little changes here:

  • Instead of manually naming tests and outputting the name in each Errorf you can just use t.Run(name, ...). I've applied this to all tests.
  • Now that each subtest is running it it's own function we can restore mocked function with defer so that has been added to all tests that use mocked functions.
  • Finally migrated all tests to use the got/wanted over got/expected (or similar). Mostly just for standardization.

Copy link
Contributor

@rking788 rking788 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -36,10 +36,9 @@ func main() {
http.ListenAndServe(":8080", nil)
}

func onLaunch(launchRequest *request.LaunchRequest) (*response.Response, map[string]interface{}, error) {
func onLaunch(launchRequest *request.LaunchRequest, metadata *request.Metadata) (*response.Response, map[string]interface{}, error) {
resp := response.New()
resp.SetEndSession(response.Bool(true))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the session stay open if the user is launching the skill? seems like the example could be misleading.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth adding some speech here so if the user tries it out then they can at least get some output speech?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonably. It's on my "todo" list but I'm currently getting slammed at work. Hope to have time later this week to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants