From 4064bcacdef782e6edb4150edd02dce17f3d7b39 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Fri, 15 Dec 2023 17:39:54 +0000 Subject: [PATCH] Correctly order util tests --- test/utils.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/utils.js b/test/utils.js index a4d8d08..2ccd08a 100644 --- a/test/utils.js +++ b/test/utils.js @@ -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' } } } @@ -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') + }) })