From dc40bbb833520b2cac67b3cfe7f76a1ed8ca6204 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 23 Aug 2022 11:24:01 +0100 Subject: [PATCH] fix: fixed tests --- test/lib/next-test-utils.js | 6 +++--- test/production/required-server-files-i18n.test.ts | 8 ++++---- test/production/required-server-files.test.ts | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/lib/next-test-utils.js b/test/lib/next-test-utils.js index c13d00551ab7..a837b45f8931 100644 --- a/test/lib/next-test-utils.js +++ b/test/lib/next-test-utils.js @@ -119,7 +119,7 @@ export function renderViaAPI(app, pathname, query) { /** * @param {string} appPort * @param {string} pathname - * @param {Record | undefined} [query] + * @param {Record | string | undefined} [query] * @param {import('node-fetch').RequestInit} [opts] * @returns {Promise} */ @@ -128,9 +128,9 @@ export function renderViaHTTP(appPort, pathname, query, opts) { } /** - * @param {string} appPort + * @param {string | number} appPort * @param {string} pathname - * @param {Record | undefined} [query] + * @param {Record | string | undefined} [query] * @param {import('node-fetch').RequestInit} [opts] * @returns {Promise} */ diff --git a/test/production/required-server-files-i18n.test.ts b/test/production/required-server-files-i18n.test.ts index 17c5df1c80df..8d290d779df5 100644 --- a/test/production/required-server-files-i18n.test.ts +++ b/test/production/required-server-files-i18n.test.ts @@ -171,7 +171,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'show') const res = await fetchViaHTTP(appPort, '/gsp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) expect(res.status).toBe(200) expect(res.headers.get('cache-control')).toBe( @@ -182,7 +182,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'hide') const res2 = await fetchViaHTTP(appPort, '/gsp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) expect(res2.status).toBe(404) expect(res2.headers.get('cache-control')).toBe( @@ -194,7 +194,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'show') const res = await fetchViaHTTP(appPort, '/gssp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) expect(res.status).toBe(200) expect(res.headers.get('cache-control')).toBe( @@ -204,7 +204,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'hide') const res2 = await fetchViaHTTP(appPort, '/gssp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) await next.patchFile('standalone/data.txt', 'show') diff --git a/test/production/required-server-files.test.ts b/test/production/required-server-files.test.ts index 9f2446f93c99..4e3b11a902f3 100644 --- a/test/production/required-server-files.test.ts +++ b/test/production/required-server-files.test.ts @@ -416,7 +416,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'show') const res = await fetchViaHTTP(appPort, '/gsp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) expect(res.status).toBe(200) expect(res.headers.get('cache-control')).toBe( @@ -427,7 +427,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'hide') const res2 = await fetchViaHTTP(appPort, '/gsp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) expect(res2.status).toBe(404) expect(res2.headers.get('cache-control')).toBe( @@ -439,7 +439,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'show') const res = await fetchViaHTTP(appPort, '/gssp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) expect(res.status).toBe(200) expect(res.headers.get('cache-control')).toBe( @@ -449,7 +449,7 @@ describe('should set-up next', () => { await next.patchFile('standalone/data.txt', 'hide') const res2 = await fetchViaHTTP(appPort, '/gssp', undefined, { - redirect: 'manual ', + redirect: 'manual', }) await next.patchFile('standalone/data.txt', 'show')