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

use-travis-to-deploy-prod
Nolan Lawson 2018-11-11 11:12:41 -08:00 zatwierdzone przez GitHub
rodzic 8dd9f00135
commit 6bb4c80450
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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