[**@cprussin/jest-config v3.1.4**](../../README.md)

***

# Function: nextjs()

> **nextjs**(`extra`): `Promise`\<\{ `automock?`: `boolean`; `bail?`: `number` \| `boolean`; `cache?`: `boolean`; `cacheDirectory?`: `string`; `changedFilesWithAncestor?`: `boolean`; `changedSince?`: `string`; `ci?`: `boolean`; `clearMocks?`: `boolean`; `collectCoverage?`: `boolean`; `collectCoverageFrom?`: `string`[]; `coverageDirectory?`: `string`; `coveragePathIgnorePatterns?`: `string`[]; `coverageProvider?`: `"babel"` \| `"v8"`; `coverageReporters?`: (`"json"` \| `"clover"` \| `"cobertura"` \| `"html-spa"` \| `"html"` \| `"json-summary"` \| `"lcov"` \| `"lcovonly"` \| `"none"` \| `"teamcity"` \| `"text"` \| `"text-lcov"` \| `"text-summary"` \| \[`"json"` \| `"clover"` \| `"cobertura"` \| `"html-spa"` \| `"html"` \| `"json-summary"` \| `"lcov"` \| `"lcovonly"` \| `"none"` \| `"teamcity"` \| `"text"` \| `"text-lcov"` \| `"text-summary"`, \{[`key`: `string`]: `unknown`; \}\])[]; `coverageThreshold?`: \{[`path`: `string`]: `object`; `global`: \{ `branches?`: `number`; `functions?`: `number`; `lines?`: `number`; `statements?`: `number`; \}; \}; `dependencyExtractor?`: `string`; `detectLeaks?`: `boolean`; `detectOpenHandles?`: `boolean`; `displayName?`: `string` \| \{ `color`: `"black"` \| `"red"` \| `"green"` \| `"yellow"` \| `"blue"` \| `"magenta"` \| `"cyan"` \| `"white"` \| `"gray"` \| `"grey"` \| `"blackBright"` \| `"redBright"` \| `"greenBright"` \| `"yellowBright"` \| `"blueBright"` \| `"magentaBright"` \| `"cyanBright"` \| `"whiteBright"`; `name`: `string`; \}; `errorOnDeprecated?`: `boolean`; `expand?`: `boolean`; `extensionsToTreatAsEsm?`: `string`[]; `fakeTimers?`: \{ enableGlobally?: boolean; \} & (\{ advanceTimers?: number \| boolean; doNotFake?: ("Date" \| "hrtime" \| "nextTick" \| "performance" \| "queueMicrotask" \| "requestAnimationFrame" \| "cancelAnimationFrame" \| ... 7 more ... \| "clearTimeout")\[\]; now?: number; timerLimit?: number; legacyFakeTimers?: false; \} \| \{ ...; \}); `filter?`: `string`; `findRelatedTests?`: `boolean`; `forceCoverageMatch?`: `string`[]; `forceExit?`: `boolean`; `globals?`: \{[`key`: `string`]: `unknown`; \}; `globalSetup?`: `string` \| `null`; `globalTeardown?`: `string` \| `null`; `haste?`: \{ `computeSha1?`: `boolean`; `defaultPlatform?`: `string` \| `null`; `enableSymlinks?`: `boolean`; `forceNodeFilesystemAPI?`: `boolean`; `hasteImplModulePath?`: `string`; `hasteMapModulePath?`: `string`; `platforms?`: `string`[]; `retainAllFiles?`: `boolean`; `throwOnModuleCollision?`: `boolean`; \}; `id?`: `string`; `injectGlobals?`: `boolean`; `json?`: `boolean`; `lastCommit?`: `boolean`; `listTests?`: `boolean`; `logHeapUsage?`: `boolean`; `maxConcurrency?`: `number`; `maxWorkers?`: `string` \| `number`; `moduleDirectories?`: `string`[]; `moduleFileExtensions?`: `string`[]; `moduleNameMapper?`: \{[`key`: `string`]: `string` \| `string`[]; \}; `modulePathIgnorePatterns?`: `string`[]; `modulePaths?`: `string`[]; `noStackTrace?`: `boolean`; `notify?`: `boolean`; `notifyMode?`: `string`; `onlyChanged?`: `boolean`; `onlyFailures?`: `boolean`; `openHandlesTimeout?`: `number`; `outputFile?`: `string`; `passWithNoTests?`: `boolean`; `preset?`: `string` \| `null`; `prettierPath?`: `string` \| `null`; `projects?`: (`string` \| \{[`key`: `string`]: `unknown`; \})[]; `randomize?`: `boolean`; `replname?`: `string` \| `null`; `reporters?`: (`string` \| \[`string`, \{[`key`: `string`]: `unknown`; \}\])[]; `resetMocks?`: `boolean`; `resetModules?`: `boolean`; `resolver?`: `string` \| `null`; `restoreMocks?`: `boolean`; `rootDir?`: `string`; `roots?`: `string`[]; `runner?`: `string`; `runTestsByPath?`: `boolean`; `runtime?`: `string`; `sandboxInjectedGlobals?`: `string`[]; `setupFiles?`: `string`[]; `setupFilesAfterEnv?`: `string`[]; `showSeed?`: `boolean`; `silent?`: `boolean`; `skipFilter?`: `boolean`; `skipNodeResolution?`: `boolean`; `slowTestThreshold?`: `number`; `snapshotFormat?`: \{ `callToJSON?`: `boolean`; `compareKeys?`: `null`; `escapeRegex?`: `boolean`; `escapeString?`: `boolean`; `highlight?`: `boolean`; `indent?`: `number`; `maxDepth?`: `number`; `maxWidth?`: `number`; `min?`: `boolean`; `printBasicPrototype?`: `boolean`; `printFunctionName?`: `boolean`; `theme?`: \{ `comment?`: `string`; `content?`: `string`; `prop?`: `string`; `tag?`: `string`; `value?`: `string`; \}; \}; `snapshotResolver?`: `string`; `snapshotSerializers?`: `string`[]; `testEnvironment?`: `string`; `testEnvironmentOptions?`: \{[`key`: `string`]: `unknown`; \}; `testFailureExitCode?`: `number`; `testLocationInResults?`: `boolean`; `testMatch?`: `string`[]; `testNamePattern?`: `string`; `testPathIgnorePatterns?`: `string`[]; `testRegex?`: `string` \| `string`[]; `testResultsProcessor?`: `string`; `testRunner?`: `string`; `testSequencer?`: `string`; `testTimeout?`: `number`; `transform?`: \{[`key`: `string`]: `string` \| \[`string`, `unknown`\]; \}; `transformIgnorePatterns?`: `string`[]; `unmockedModulePathPatterns?`: `string`[]; `updateSnapshot?`: `boolean`; `useStderr?`: `boolean`; `verbose?`: `boolean`; `waitForUnhandledRejections?`: `boolean`; `watch?`: `boolean`; `watchAll?`: `boolean`; `watchman?`: `boolean`; `watchPathIgnorePatterns?`: `string`[]; `watchPlugins?`: (`string` \| \[`string`, `unknown`\])[]; `workerIdleMemoryLimit?`: `string` \| `number`; `workerThreads?`: `boolean`; \}\>

Defined in: [packages/jest-config/src/next.ts:35](https://github.com/cprussin/cprussin-monorepo/blob/45be92bc13a41d9f46c6ab9ed2d9a61167827e46/packages/jest-config/src/next.ts#L35)

This configuration adds to the base config by wrapping the unit test project
by calling `next/jest`. It also adds the `jest-environment-jsdom` test
environment, and sets up `@testing-library/jest-dom`.

## Parameters

### extra

`ExtraConfigs` = `{}`

extensions and wrappers for the projects and global jest config

## Returns

`Promise`\<\{ `automock?`: `boolean`; `bail?`: `number` \| `boolean`; `cache?`: `boolean`; `cacheDirectory?`: `string`; `changedFilesWithAncestor?`: `boolean`; `changedSince?`: `string`; `ci?`: `boolean`; `clearMocks?`: `boolean`; `collectCoverage?`: `boolean`; `collectCoverageFrom?`: `string`[]; `coverageDirectory?`: `string`; `coveragePathIgnorePatterns?`: `string`[]; `coverageProvider?`: `"babel"` \| `"v8"`; `coverageReporters?`: (`"json"` \| `"clover"` \| `"cobertura"` \| `"html-spa"` \| `"html"` \| `"json-summary"` \| `"lcov"` \| `"lcovonly"` \| `"none"` \| `"teamcity"` \| `"text"` \| `"text-lcov"` \| `"text-summary"` \| \[`"json"` \| `"clover"` \| `"cobertura"` \| `"html-spa"` \| `"html"` \| `"json-summary"` \| `"lcov"` \| `"lcovonly"` \| `"none"` \| `"teamcity"` \| `"text"` \| `"text-lcov"` \| `"text-summary"`, \{[`key`: `string`]: `unknown`; \}\])[]; `coverageThreshold?`: \{[`path`: `string`]: `object`; `global`: \{ `branches?`: `number`; `functions?`: `number`; `lines?`: `number`; `statements?`: `number`; \}; \}; `dependencyExtractor?`: `string`; `detectLeaks?`: `boolean`; `detectOpenHandles?`: `boolean`; `displayName?`: `string` \| \{ `color`: `"black"` \| `"red"` \| `"green"` \| `"yellow"` \| `"blue"` \| `"magenta"` \| `"cyan"` \| `"white"` \| `"gray"` \| `"grey"` \| `"blackBright"` \| `"redBright"` \| `"greenBright"` \| `"yellowBright"` \| `"blueBright"` \| `"magentaBright"` \| `"cyanBright"` \| `"whiteBright"`; `name`: `string`; \}; `errorOnDeprecated?`: `boolean`; `expand?`: `boolean`; `extensionsToTreatAsEsm?`: `string`[]; `fakeTimers?`: \{ enableGlobally?: boolean; \} & (\{ advanceTimers?: number \| boolean; doNotFake?: ("Date" \| "hrtime" \| "nextTick" \| "performance" \| "queueMicrotask" \| "requestAnimationFrame" \| "cancelAnimationFrame" \| ... 7 more ... \| "clearTimeout")\[\]; now?: number; timerLimit?: number; legacyFakeTimers?: false; \} \| \{ ...; \}); `filter?`: `string`; `findRelatedTests?`: `boolean`; `forceCoverageMatch?`: `string`[]; `forceExit?`: `boolean`; `globals?`: \{[`key`: `string`]: `unknown`; \}; `globalSetup?`: `string` \| `null`; `globalTeardown?`: `string` \| `null`; `haste?`: \{ `computeSha1?`: `boolean`; `defaultPlatform?`: `string` \| `null`; `enableSymlinks?`: `boolean`; `forceNodeFilesystemAPI?`: `boolean`; `hasteImplModulePath?`: `string`; `hasteMapModulePath?`: `string`; `platforms?`: `string`[]; `retainAllFiles?`: `boolean`; `throwOnModuleCollision?`: `boolean`; \}; `id?`: `string`; `injectGlobals?`: `boolean`; `json?`: `boolean`; `lastCommit?`: `boolean`; `listTests?`: `boolean`; `logHeapUsage?`: `boolean`; `maxConcurrency?`: `number`; `maxWorkers?`: `string` \| `number`; `moduleDirectories?`: `string`[]; `moduleFileExtensions?`: `string`[]; `moduleNameMapper?`: \{[`key`: `string`]: `string` \| `string`[]; \}; `modulePathIgnorePatterns?`: `string`[]; `modulePaths?`: `string`[]; `noStackTrace?`: `boolean`; `notify?`: `boolean`; `notifyMode?`: `string`; `onlyChanged?`: `boolean`; `onlyFailures?`: `boolean`; `openHandlesTimeout?`: `number`; `outputFile?`: `string`; `passWithNoTests?`: `boolean`; `preset?`: `string` \| `null`; `prettierPath?`: `string` \| `null`; `projects?`: (`string` \| \{[`key`: `string`]: `unknown`; \})[]; `randomize?`: `boolean`; `replname?`: `string` \| `null`; `reporters?`: (`string` \| \[`string`, \{[`key`: `string`]: `unknown`; \}\])[]; `resetMocks?`: `boolean`; `resetModules?`: `boolean`; `resolver?`: `string` \| `null`; `restoreMocks?`: `boolean`; `rootDir?`: `string`; `roots?`: `string`[]; `runner?`: `string`; `runTestsByPath?`: `boolean`; `runtime?`: `string`; `sandboxInjectedGlobals?`: `string`[]; `setupFiles?`: `string`[]; `setupFilesAfterEnv?`: `string`[]; `showSeed?`: `boolean`; `silent?`: `boolean`; `skipFilter?`: `boolean`; `skipNodeResolution?`: `boolean`; `slowTestThreshold?`: `number`; `snapshotFormat?`: \{ `callToJSON?`: `boolean`; `compareKeys?`: `null`; `escapeRegex?`: `boolean`; `escapeString?`: `boolean`; `highlight?`: `boolean`; `indent?`: `number`; `maxDepth?`: `number`; `maxWidth?`: `number`; `min?`: `boolean`; `printBasicPrototype?`: `boolean`; `printFunctionName?`: `boolean`; `theme?`: \{ `comment?`: `string`; `content?`: `string`; `prop?`: `string`; `tag?`: `string`; `value?`: `string`; \}; \}; `snapshotResolver?`: `string`; `snapshotSerializers?`: `string`[]; `testEnvironment?`: `string`; `testEnvironmentOptions?`: \{[`key`: `string`]: `unknown`; \}; `testFailureExitCode?`: `number`; `testLocationInResults?`: `boolean`; `testMatch?`: `string`[]; `testNamePattern?`: `string`; `testPathIgnorePatterns?`: `string`[]; `testRegex?`: `string` \| `string`[]; `testResultsProcessor?`: `string`; `testRunner?`: `string`; `testSequencer?`: `string`; `testTimeout?`: `number`; `transform?`: \{[`key`: `string`]: `string` \| \[`string`, `unknown`\]; \}; `transformIgnorePatterns?`: `string`[]; `unmockedModulePathPatterns?`: `string`[]; `updateSnapshot?`: `boolean`; `useStderr?`: `boolean`; `verbose?`: `boolean`; `waitForUnhandledRejections?`: `boolean`; `watch?`: `boolean`; `watchAll?`: `boolean`; `watchman?`: `boolean`; `watchPathIgnorePatterns?`: `string`[]; `watchPlugins?`: (`string` \| \[`string`, `unknown`\])[]; `workerIdleMemoryLimit?`: `string` \| `number`; `workerThreads?`: `boolean`; \}\>

the jest config

## Examples

```js
// jest.config.js
export { nextjs as default } from "@cprussin/jest-config";
```

```js
// jest.config.js
import { nextjs } from "@cprussin/jest-config";
export default nextjs({
  global: {
    config: {
      passWithnoTests: true
    }
  }
})
```
