Skip to content

Commit

Permalink
Initialize and declare initial values
Browse files Browse the repository at this point in the history
  • Loading branch information
chooban committed Jul 13, 2020
1 parent 07c4f17 commit 7b8564d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/gatsby/src/query/__tests__/better-queue-custom-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ describe(`Custom better-queue memory store`, () => {
await store.putTask(`task2`, { value: `secret 2` }, 1)
await store.putTask(`task3`, { value: `secret 3` }, 1)

let lockId
let tasks

lockId = await store.takeFirstN(2)
tasks = await store.getLock(lockId)
let lockId = await store.takeFirstN(2)
let tasks = await store.getLock(lockId)

// should get the first task
expect(tasks.task1.value).toBe(`secret 1`)
Expand Down Expand Up @@ -111,9 +108,7 @@ describe(`Custom better-queue memory store`, () => {
const lock1: string = await store.takeFirstN(1)
const lock2: string = await store.takeLastN(1)

let workers

workers = await store.getRunningTasks()
let workers = await store.getRunningTasks()

// should have first lock
expect(workers[lock1]).toBeDefined()
Expand Down

0 comments on commit 7b8564d

Please sign in to comment.