From c905fda59060d0f485938851a1d493d491b06c5a Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 2 May 2022 09:59:38 -0500 Subject: [PATCH] Fix swc jest pagesDir config (#36623) This updates the `pagesDir` config for the new return shape updated in https://github.com/vercel/next.js/pull/36619, no additional tests were added as existing tests were failing from this. x-ref: https://github.com/vercel/next.js/runs/6257712883?check_suite_focus=true x-ref: https://github.com/vercel/next.js/runs/6257712805?check_suite_focus=true x-ref: https://github.com/vercel/next.js/pull/36619 --- packages/next/build/jest/jest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/build/jest/jest.ts b/packages/next/build/jest/jest.ts index 242fee709f2e2bc..ab3108d792daa7b 100644 --- a/packages/next/build/jest/jest.ts +++ b/packages/next/build/jest/jest.ts @@ -51,11 +51,11 @@ export default function nextJest(options: { dir?: string } = {}) { let jsConfig let resolvedBaseUrl let isEsmProject = false - let pagesDir + let pagesDir: string | undefined if (options.dir) { const resolvedDir = resolve(options.dir) - pagesDir = findPagesDir(resolvedDir) + pagesDir = findPagesDir(resolvedDir).pages const packageConfig = loadClosestPackageJson(resolvedDir) isEsmProject = packageConfig.type === 'module'