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

Avoid jest watch race condition #113

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

EvanOxfeld
Copy link
Contributor

Fixes #112

@@ -70,7 +73,5 @@ async function createTables(dynamoDB, tables) {
}

async function deleteTables(dynamoDB, tableNames) {
return Promise.all(
tableNames.map(tableName => dynamoDB.deleteTable({TableName: tableName}).promise())
Copy link
Member

Choose a reason for hiding this comment

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

Hey! Thank you for your contribution.

Why do you want to remove .promise() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@randomhash Thanks for reviewing! .promise() failed for me because jest-dynamodb uses AWS SDK v3 but .promise() is only part of the AWS SDK v2 API.

.promise() is required with v2 because deleteTable v2 returns an AWS.Request with a promise method that must be called. Instead, in v3 deleteTable returns a Promise.

Also see the Migrating to AWS SDK v3 guide which includes an example of removing .promise() calls when upgrading to AWS SDK v3.

@ruipaulo
Copy link

Hi, could this be merged? This bug is really slowing us down in development as --watch is unusable currently.

@vladholubiev vladholubiev merged commit 9d55362 into shelfio:master Dec 16, 2021
@vladholubiev
Copy link
Member

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

Successfully merging this pull request may close these issues.

Setup race condition with Jest watch results in a ResourceInUseException
4 participants