Skip to content

fix: comm-chat: remove mocha arrow functions#24127

Merged
jeremymeng merged 1 commit intoAzure:mainfrom
StevanFreeborn:fix/comm-chat-remove-mocha-arrow-functions
Feb 14, 2023
Merged

fix: comm-chat: remove mocha arrow functions#24127
jeremymeng merged 1 commit intoAzure:mainfrom
StevanFreeborn:fix/comm-chat-remove-mocha-arrow-functions

Conversation

@StevanFreeborn
Copy link
Contributor

Packages impacted by this PR

sdk\communication\communication-chat

Issues associated with this PR

#13005

Describe the problem that is addressed by this PR

The existing mocha tests for the sdk\communication\communication-chat made use of the arrow syntax for callback functions. Mocha recommends not to do this because you lose access to the mocha context (https://mochajs.org/#arrow-functions).

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

The reason for utilizing the function keyword instead of an arrow syntax to write the callback functions in these mocha tests is to maintain access to the mocha context.

Are there test cases added in this PR? (If not, why?)

No additional test cases were added in this PR as the change only required modifying existing test cases.

Provide a list of related PRs (if any)

#23761 - Same fix, but for the sdk\search\search-documents package
#23789 - Same fix but for the sdk\attestation\attestation package
#23835 - Same fix but for the sdk\batch\batch package
#23850 - Same fix but for the sdk\cognitivelanguage\ai-language-conversations package
#23881 - Same fix but for the sdk\cognitiveservices\cognitiveservices-luis-authoring
#24126 - Same fix but for the sdk\cognitiveservices\cognitiveservices-luis-runtime

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Not applicable

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
    • I don't believe this is relevant.
  • Added a changelog (if necessary)
    • I don't believe this is necessary

@ghost ghost added Communication customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Dec 5, 2022
@ghost
Copy link

ghost commented Dec 5, 2022

Thank you for your contribution StevanFreeborn! We will review the pull request and get back to you soon.

@StevanFreeborn
Copy link
Contributor Author

@LuChen-Microsoft I'm just bumping this given the time that has passed since it was opened.

@StevanFreeborn
Copy link
Contributor Author

@LuChen-Microsoft have you had a chance to review this?

@StevanFreeborn
Copy link
Contributor Author

@xirzec bumping this given the time that has passed since it was opened and haven't heard back from reviewer.

@jeremymeng jeremymeng enabled auto-merge (squash) February 14, 2023 18:03
Copy link
Member

@jeremymeng jeremymeng left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@jeremymeng jeremymeng merged commit 9ecbb85 into Azure:main Feb 14, 2023
@StevanFreeborn StevanFreeborn deleted the fix/comm-chat-remove-mocha-arrow-functions branch February 14, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Communication customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants