Skip to content

Commit

Permalink
test: use the constant TASKS_PER_ROUND (#131)
Browse files Browse the repository at this point in the history
So that we don't have to change the tests when we tweak the number
of tasks chosen for each round.

Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored Nov 13, 2023
1 parent 86c3299 commit 09e6e22
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import http from 'node:http'
import { once } from 'node:events'
import assert, { AssertionError } from 'node:assert'
import pg from 'pg'
import { maybeCreateSparkRound, mapCurrentMeridianRoundToSparkRound } from '../lib/round-tracker.js'
import {
TASKS_PER_ROUND,
maybeCreateSparkRound,
mapCurrentMeridianRoundToSparkRound
} from '../lib/round-tracker.js'

const { DATABASE_URL } = process.env
const participantAddress = 'f1abc'
Expand Down Expand Up @@ -286,7 +290,7 @@ describe('Routes', () => {
assert.deepStrictEqual(details, {
roundId: '2'
})
assert.strictEqual(retrievalTasks.length, 400)
assert.strictEqual(retrievalTasks.length, TASKS_PER_ROUND)
})

it('returns details of a SPARK round managed by older contract version', async () => {
Expand All @@ -297,7 +301,7 @@ describe('Routes', () => {
assert.deepStrictEqual(details, {
roundId: '1'
})
assert.strictEqual(retrievalTasks.length, 400)
assert.strictEqual(retrievalTasks.length, TASKS_PER_ROUND)
})

it('returns 404 for unknown round index', async () => {
Expand Down

0 comments on commit 09e6e22

Please sign in to comment.