Skip to content
/ jest Public
forked from jestjs/jest

Commit

Permalink
chore: document haste config option (jestjs#10765)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Muller <mrmeku@stairwell.com>
  • Loading branch information
SimenB and Dan Muller committed Nov 2, 2020
1 parent 97337d4 commit 038d8be
Show file tree
Hide file tree
Showing 11 changed files with 229 additions and 14 deletions.
23 changes: 22 additions & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `injectGlobals` [boolean]

Default: `true`
Expand Down Expand Up @@ -1106,7 +1127,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
5 changes: 5 additions & 0 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ export type Path = string;
export type Glob = string;

export type HasteConfig = {
/** Whether to hash files using SHA-1. */
computeSha1?: boolean;
/** The platform to use as the default, e.g. 'ios'. */
defaultPlatform?: string | null;
/** Path to a custom implementation of Haste. */
hasteImplModulePath?: string;
/** All platforms to target, e.g ['ios', 'android']. */
platforms?: Array<string>;
/** Whether to throw on error on module collision. */
throwOnModuleCollision?: boolean;
};

Expand Down
25 changes: 23 additions & 2 deletions website/versioned_docs/version-22.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,27 @@ Default: `undefined`

This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites.

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `moduleDirectories` [array\<string>]

Default: `["node_modules"]`
Expand Down Expand Up @@ -543,7 +564,7 @@ This option allows the use of a custom resolver. This resolver must be a node mo
```json
{
"basedir": string,
"browser": bool,
"browser": boolean,
"extensions": [string],
"moduleDirectory": [string],
"paths": [string],
Expand Down Expand Up @@ -835,7 +856,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
25 changes: 23 additions & 2 deletions website/versioned_docs/version-23.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,27 @@ Default: `undefined`

This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites. This function gets Jest's `globalConfig` object as a parameter.

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `moduleDirectories` [array\<string>]

Default: `["node_modules"]`
Expand Down Expand Up @@ -569,7 +590,7 @@ This option allows the use of a custom resolver. This resolver must be a node mo
```json
{
"basedir": string,
"browser": bool,
"browser": boolean,
"extensions": [string],
"moduleDirectory": [string],
"paths": [string],
Expand Down Expand Up @@ -861,7 +882,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
25 changes: 23 additions & 2 deletions website/versioned_docs/version-24.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `maxConcurrency` [number]

Default: `5`
Expand Down Expand Up @@ -668,7 +689,7 @@ This option allows the use of a custom resolver. This resolver must be a node mo
```json
{
"basedir": string,
"browser": bool,
"browser": boolean,
"defaultResolver": "function(request, options)",
"extensions": [string],
"moduleDirectory": [string],
Expand Down Expand Up @@ -1002,7 +1023,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
25 changes: 23 additions & 2 deletions website/versioned_docs/version-25.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `maxConcurrency` [number]

Default: `5`
Expand Down Expand Up @@ -692,7 +713,7 @@ This option allows the use of a custom resolver. This resolver must be a node mo
```json
{
"basedir": string,
"browser": bool,
"browser": boolean,
"defaultResolver": "function(request, options)",
"extensions": [string],
"moduleDirectory": [string],
Expand Down Expand Up @@ -1024,7 +1045,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
23 changes: 22 additions & 1 deletion website/versioned_docs/version-26.0/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `maxConcurrency` [number]

Default: `5`
Expand Down Expand Up @@ -1024,7 +1045,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
23 changes: 22 additions & 1 deletion website/versioned_docs/version-26.2/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `maxConcurrency` [number]

Default: `5`
Expand Down Expand Up @@ -1038,7 +1059,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
23 changes: 22 additions & 1 deletion website/versioned_docs/version-26.4/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `maxConcurrency` [number]

Default: `5`
Expand Down Expand Up @@ -1069,7 +1090,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down
23 changes: 22 additions & 1 deletion website/versioned_docs/version-26.5/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,27 @@ _Note: A global teardown module configured in a project (using multi-project run

_Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._

### `haste` [object]

Default: `undefined`

This will be used to configure the behavior of `jest-haste-map`, Jest's internal file crawler/cache system. The following options are supported:

```ts
type HasteConfig = {
// Whether to hash files using SHA-1.
computeSha1?: boolean;
// The platform to use as the default, e.g. 'ios'.
defaultPlatform?: string | null;
// Path to a custom implementation of Haste.
hasteImplModulePath?: string;
// All platforms to target, e.g ['ios', 'android'].
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
};
```

### `injectGlobals` [boolean]

Default: `true`
Expand Down Expand Up @@ -1087,7 +1108,7 @@ This option allows the use of a custom results processor. This processor must be

```json
{
"success": bool,
"success": boolean,
"startTime": epoch,
"numTotalTestSuites": number,
"numPassedTestSuites": number,
Expand Down

0 comments on commit 038d8be

Please sign in to comment.