-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Tests] Move all our mocha test suites to use old functions instead of arrow functions #13005
Comments
PR for new api-version: Microsoft.Cache/redis/stable/2020-12-01 [rebased + refactored] (Azure#14023) * Adds base for updating Microsoft.Cache from version stable/2020-06-01 to version 2020-12-01 * Updates readme * Updates API version in new specs and examples * Adding Redis Version to PUT request (Azure#12675) * Adding Redis Version to PUT request * Include RedisVersion in PUT and PATCH, and update description to clarify major version * Adding new properties isPrimary and replicasPerPrimary (Azure#13005) * Adding new properties isPrimary and replicasPerPrimary * Addressing PR feedback Co-authored-by: Lavanya Singampalli <lasingam@microsoft.com> * Refactor the latest redis.json API spec proposal to use the definitions ProxyResource, TrackedResource and OperationListResult from common-types/resource-management/v2. (I hope CI likes this!) * Cleanup now-unreferenced #definitions which were still flagged as duplicate definitions. * Fix linter errors for camelCasing of API names and formatting of integer types. * Fix more linter errors by adding pagable, refactoring LinkedServers and FirewallRules. These will be between-versions breaking changes for the SDK, in the name of more API consistency. * Fix linter error 'PUT' operation 'PrivateEndpointConnections_Put' should use method name 'Create'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. * Fix some duplicate example names. * Revert "Fix linter error 'PUT' operation 'PrivateEndpointConnections_Put' should use method name 'Create'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change." -- because it introduces new linter errors. * Revert "Fix more linter errors by adding pagable, refactoring LinkedServers and FirewallRules. These will be between-versions breaking changes for the SDK, in the name of more API consistency." This reverts commit c0e305128834947066bb59de2c4247b29feef5ee. * Fix the example name for CheckNameAvailability. * Add x-ms-pageable suggested by the linter. * Revert the linter fix for CheckNameAvailabiltiy camelCasing to avoid introducing new linter errors. * Use same FirewallRule response schema for PUT and GET, addressing linter errors, and have RedisFirewallRuleCreateParameters inherit it in hopes that helps with SDK backcompat. * Fix indenting. * Fix broken $ref reference syntax. * Add back the description for RedisFirewallRuleCreateParameters. * Actually run prettier. * With print width 20 * Suppress the warnings that booleans are not descriptive, since to change them would be a breaking change. * Delete unintended extra character * Revert enum type-hinting and refactors to common-types that are getting flagged as breaking changes. * Add back the refactorings to use Resource/ProxyResource/TrackedResource from common-types. Since otherwise we get "Duplicate Schema named Resource -- properties.id.description: undefined => "Fully qualified resource ID for the resource. Ex - /subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/resourceProviderNamespace/resourceType/resourceName", properties.name.description: undefined => "The name of the resource"," Co-authored-by: MECHANDR <30642185+MECHANDR@users.noreply.github.com> Co-authored-by: lasingam <68033674+lasingam@users.noreply.github.com> Co-authored-by: Lavanya Singampalli <lasingam@microsoft.com>
Even if we fix this, we should invest in a linter rule for this to avoid future failures |
Tips for folks interested in contributing to this issue:
|
Related 3rd party eslint plugin: https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-mocha-arrows.md |
@ramya-rao-a, @jeremymeng, or @deyaaeldeen could I be assigned this issue to work on? Or do I need to be assigned the issue to work on it? |
@StevanFreeborn happy to let you work on it. Was there a particular SDK you were thinking of starting with? |
@xirzec Since all the tests for all the sdks need to be re-visited I figured I'd just work alphabetically. So it looks like the first tests to be modified would be here: Any objections to that approach? Or have a particular one in mind to start with? Do you want separate PRs for each update to the individual SDKs? |
@StevanFreeborn perhaps avoid Perhaps search would be a fine starting point? Most of the unit tests should be pretty straightforward to convert, e.g. |
@xirzec ah okay good to know. I shall work accordingly. And agreed separate PRs for each SDK seems like a good way to organize it. Thank you for the direction. Very much appreciated. |
Thank you for your time and effort! Please feel free to comment here or open a draft PR if you have any trouble and we can take a look. 😄 |
Of course I very much appreciate the opportunity to contribute. I've gone ahead and opened an initial PR ( #23761 ) for making the necessary changes to the I ran the test suite locally for that package using |
### Packages impacted by this PR `sdk\attestation\attestation` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\attestation\attestation` 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 ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_** ### Notes I did run the package's test suite before and after the changes to confirm all remains as it should be.
### Packages impacted by this PR `sdk\batch\batch` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\attestation\attestation` 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 ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\cognitivelanguage\ai-language-conversations` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\cognitivelanguage\ai-language-conversations` 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 ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\cognitiveservices\cognitiveservices-luis-runtime` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` 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` ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\communication\communication-common` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-common` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\communication\communication-email` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-email` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\communication\communication-identity` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-identity` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package #24747 - Same fix but for the `sdk\communication\communication-email` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\communication\communication-rooms` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-rooms` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package #24747 - Same fix but for the `sdk\communication\communication-email` package #24797 - Same fix but for the `sdk\communication\communication-identity` package #24799 - Same fix but for the `sdk\communication\communication-job-router` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### 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 - [x] 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](https://github.com/Azure/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_**
…s in test directory (#24865) ### Packages impacted by this PR `sdk\communication\communication-job-router` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-job-router` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package #24747 - Same fix but for the `sdk\communication\communication-email` package #24797 - Same fix but for the `sdk\communication\communication-identity` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\confidentialledger\confidential-ledger-rest` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\confidentialledger\confidential-ledger-rest` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package #24747 - Same fix but for the `sdk\communication\communication-email` package #24797 - Same fix but for the `sdk\communication\communication-identity` package #24865 - Same fix but for the `sdk\communication\communication-job-router` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/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_**
### Packages impacted by this PR `sdk\communication\communication-sms` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-sms` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package #24747 - Same fix but for the `sdk\communication\communication-email` package #24797 - Same fix but for the `sdk\communication\communication-identity` package #24800 - Same fix but for the `sdk\communication\communication-rooms` package #24865 - Same fix but for the `sdk\communication\communication-job-router` package #25148 - Same fix but for the `sdk\confidentialledger\confidential-ledger-rest` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
### Packages impacted by this PR `sdk\communication\communication-sms` ### Issues associated with this PR #13005 ### Describe the problem that is addressed by this PR The existing mocha tests for the `sdk\communication\communication-sms` 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` package #24126 - Same fix but for the `sdk\cognitiveservices\cognitiveservices-luis-runtime` package #21470 - Same fix but for the `sdk\communication\communication-chat` package #24746 - Same fix but for the `sdk\communication\communication-common` package #24747 - Same fix but for the `sdk\communication\communication-email` package #24797 - Same fix but for the `sdk\communication\communication-identity` package #24800 - Same fix but for the `sdk\communication\communication-rooms` package #24865 - Same fix but for the `sdk\communication\communication-job-router` package #25148 - Same fix but for the `sdk\confidentialledger\confidential-ledger-rest` package ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ **_Not applicable_** ### Checklists - [x] 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](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
Hi @deyaaeldeen, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
This is advised by mocha team (see https://mochajs.org/#arrow-functions) and can cause issues that are hard to debug. It was a primary reason for failures in #12819. My concern is if we were to access/update mocha context later in our unit tests, we will run into this issue if the unit tests are still written using the lambda syntax. This could cause hours in lost productivity.
The text was updated successfully, but these errors were encountered: