Skip to content

Commit

Permalink
Correctly order util tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Dec 15, 2023
1 parent 2960010 commit 4064bca
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ const { describe, it } = require('node:test')
const utils = require('../lib/utils.js')

describe('Utility functions', () => {
it('Gets original query string', () => {
const req1 = { originalUrl: '/admin/new?sort=desc' }
const req2 = { originalUrl: '/admin/new?sort=desc&page=1' }

assert.equal(utils.getOriginalQuery(req1), '?sort=desc')
assert.equal(utils.getOriginalQuery(req2), '?sort=desc&page=1')
})

it('Gets path to fork', async (t) => {
const req = { session: { data: { country: 'England' } } }

Expand Down Expand Up @@ -90,4 +82,12 @@ describe('Utility functions', () => {
assert.equal(utils.getFork(forks, req), '/country')
})
})

it('Gets original query string', () => {
const req1 = { originalUrl: '/admin/new?sort=desc' }
const req2 = { originalUrl: '/admin/new?sort=desc&page=1' }

assert.equal(utils.getOriginalQuery(req1), '?sort=desc')
assert.equal(utils.getOriginalQuery(req2), '?sort=desc&page=1')
})
})

0 comments on commit 4064bca

Please sign in to comment.