Skip to content

Commit

Permalink
Fix swc jest pagesDir config (#36623)
Browse files Browse the repository at this point in the history
This updates the `pagesDir` config for the new return shape updated in #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: #36619
  • Loading branch information
ijjk authored May 2, 2022
1 parent 4eee0e3 commit c905fda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next/build/jest/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit c905fda

Please sign in to comment.