Skip to content

Commit

Permalink
feat(react): make React schematics use babel-jest by default (#3154)
Browse files Browse the repository at this point in the history
* feat(react): make React schematics use babel-jest by default

The babelJest option was removed from the React application
and library schematics and set to true by default

ISSUES CLOSED: 2365

* feat(react): remove babelJest option test
  • Loading branch information
BigAB committed Jun 11, 2020
1 parent d17d437 commit 2700cb7
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 73 deletions.
10 changes: 0 additions & 10 deletions docs/angular/api-react/schematics/application.md
Expand Up @@ -48,16 +48,6 @@ nx g app myapp --routing

## Options

### babelJest

Alias(es): babel-jest

Default: `false`

Type: `boolean`

Use babel-jest instead of ts-jest

### classComponent

Alias(es): C
Expand Down
10 changes: 0 additions & 10 deletions docs/angular/api-react/schematics/library.md
Expand Up @@ -50,16 +50,6 @@ Type: `string`

The application project to add the library route to

### babelJest

Alias(es): babel-jest

Default: `false`

Type: `boolean`

Use babel-jest instead of ts-jest

### component

Default: `true`
Expand Down
10 changes: 0 additions & 10 deletions docs/react/api-react/schematics/application.md
Expand Up @@ -48,16 +48,6 @@ nx g app myapp --routing

## Options

### babelJest

Alias(es): babel-jest

Default: `false`

Type: `boolean`

Use babel-jest instead of ts-jest

### classComponent

Alias(es): C
Expand Down
10 changes: 0 additions & 10 deletions docs/react/api-react/schematics/library.md
Expand Up @@ -50,16 +50,6 @@ Type: `string`

The application project to add the library route to

### babelJest

Alias(es): babel-jest

Default: `false`

Type: `boolean`

Use babel-jest instead of ts-jest

### component

Default: `true`
Expand Down
19 changes: 0 additions & 19 deletions e2e/react/src/react.test.ts
Expand Up @@ -199,25 +199,6 @@ forEachCli((currentCLIName) => {
);
}, 120000);

it('should be able to use babel-jest', async () => {
ensureProject();
const appName = uniq('app');
const libName = uniq('lib');

runCLI(
`generate @nrwl/react:app ${appName} --no-interactive --babelJest`
);
runCLI(
`generate @nrwl/react:lib ${libName} --no-interactive --babelJest`
);

const appTestResults = await runCLIAsync(`test ${appName}`);
expect(appTestResults.stderr).toContain('Test Suites: 1 passed, 1 total');

const libTestResults = await runCLIAsync(`test ${libName}`);
expect(libTestResults.stderr).toContain('Test Suites: 1 passed, 1 total');
}, 120000);

it('should be able to add a redux slice', async () => {
ensureProject();
const appName = uniq('app');
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/schematics/application/lib/add-jest.ts
Expand Up @@ -8,7 +8,7 @@ export function addJest(options: NormalizedSchema): Rule {
supportTsx: true,
skipSerializers: true,
setupFile: 'none',
babelJest: options.babelJest,
babelJest: true,
})
: noop();
}
6 changes: 0 additions & 6 deletions packages/react/src/schematics/application/schema.json
Expand Up @@ -97,12 +97,6 @@
"description": "Test runner to use for unit tests",
"default": "jest"
},
"babelJest": {
"type": "boolean",
"alias": "babel-jest",
"description": "Use babel-jest instead of ts-jest",
"default": false
},
"e2eTestRunner": {
"type": "string",
"enum": ["cypress", "none"],
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/schematics/library/library.ts
Expand Up @@ -84,7 +84,7 @@ export default function (schema: Schema): Rule {
setupFile: 'none',
supportTsx: true,
skipSerializers: true,
babelJest: options.babelJest,
babelJest: true,
})
: noop(),
options.component
Expand Down
6 changes: 0 additions & 6 deletions packages/react/src/schematics/library/schema.json
Expand Up @@ -77,12 +77,6 @@
"description": "Test runner to use for unit tests",
"default": "jest"
},
"babelJest": {
"type": "boolean",
"alias": "babel-jest",
"description": "Use babel-jest instead of ts-jest",
"default": false
},
"tags": {
"type": "string",
"description": "Add tags to the library (used for linting)",
Expand Down

0 comments on commit 2700cb7

Please sign in to comment.