Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react): make React schematics use babel-jest by default #3154

Merged
merged 2 commits into from Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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