chore(tests): avoid delaying when inserting every post in tests (#625)

This commit is contained in:
Nolan Lawson 2018-11-11 11:12:41 -08:00 committed by GitHub
parent 8dd9f00135
commit 6bb4c80450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ export async function restoreMastodonData () {
console.log('Restoring mastodon data...')
let internalIdsToIds = {}
for (let action of actions) {
await new Promise(resolve => setTimeout(resolve, 1000)) // delay so that notifications have proper order
if (!action.post) {
// If the action is a boost, favorite, etc., then it needs to
// be delayed, otherwise it may appear in an unpredictable order and break the tests.
await new Promise(resolve => setTimeout(resolve, 1000))
}
console.log(JSON.stringify(action))
let accessToken = users[action.user].accessToken