Skip to content
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

Replace done w/ async part 2 #3416

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

mdrichardson
Copy link
Contributor

Partial fix for #3226. This will be done in multiple PRs.

Covers

(Alphabetically such that botbuilder comes before botbuilder-)

  • botbuilder-ai through botbuilder-applicationinsights, inclusive

Excludes

Description

Replaces the use of done() in tests with proper async/await.

Specific Changes

  • done => async/await
  • Remove done completely when used in synchronous tests. For example, it was in some beforeEach() hooks, but it's not needed; nock doesn't even use it there
  • Remove some of the try/catches that are no longer needed since we don't need done(err)
  • Avoid arrow function in mocha tests
  • A lot of no-op stuff auto-fixes with our prettier/eslint settings

Notes (mostly for me)

  • Regex for finding done usage: (done =>)|\(done\)
  • Search in: ./libraries/**/**/tests/**/*.js
  • For adding await to adapter.send() calls: (?<!(await)|(const))\sadapter

@@ -100,59 +98,90 @@ function GetLuisRecognizer(application, options, includeApiResults) {
return new LuisRecognizer(application, optsV3);
}

function throttle(callback) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: This is moved into afterEach(), below

@coveralls
Copy link

coveralls commented Mar 19, 2021

Pull Request Test Coverage Report for Build 676716494

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 85.084%

Totals Coverage Status
Change from base Build 665654550: 0.04%
Covered Lines: 18786
Relevant Lines: 21032

💛 - Coveralls

Copy link
Contributor

@joshgummersall joshgummersall left a comment

Choose a reason for hiding this comment

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

One quick comment, otherwise it looks good.

@mdrichardson mdrichardson marked this pull request as ready for review March 22, 2021 16:32
@mdrichardson mdrichardson requested review from a team as code owners March 22, 2021 16:32
@joshgummersall joshgummersall merged commit abeef13 into microsoft:main Mar 22, 2021
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.

3 participants