feat(angular): remove protractor (#15627)
This commit is contained in:
parent
942f984231
commit
7812f41994
@ -15,12 +15,12 @@
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "angular",
|
||||
"packageName": "@nrwl/angular",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"documents": {
|
||||
"/packages/angular/documents/overview": {
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"file": "generated/packages/angular/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
@ -31,7 +31,7 @@
|
||||
"/packages/angular/documents/angular-nx-version-matrix": {
|
||||
"id": "angular-nx-version-matrix",
|
||||
"name": "Angular and Nx Version Matrix",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"file": "generated/packages/angular/documents/angular-nx-version-matrix",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
|
||||
@ -11,12 +11,12 @@
|
||||
"source": "/packages/add-nx-to-monorepo/src"
|
||||
},
|
||||
{
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"documents": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"file": "generated/packages/angular/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
@ -27,7 +27,7 @@
|
||||
{
|
||||
"id": "angular-nx-version-matrix",
|
||||
"name": "Angular and Nx Version Matrix",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"file": "generated/packages/angular/documents/angular-nx-version-matrix",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides:
|
||||
The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries
|
||||
within an Nx workspace. It provides:
|
||||
|
||||
- Integration with libraries such as Storybook, Jest, Cypress, Karma, and Protractor.
|
||||
- Integration with libraries such as Storybook, Jest and Cypress.
|
||||
- Generators to help scaffold code quickly, including:
|
||||
- Micro Frontends
|
||||
- Libraries, both internal to your codebase and publishable to npm
|
||||
@ -10,7 +11,8 @@ The Nx Plugin for Angular contains executors, generators, and utilities for mana
|
||||
- Utilities for automatic workspace refactoring.
|
||||
|
||||
{% callout type="note" title="Currently using the Angular CLI?" %}
|
||||
You can easily and mostly **automatically migrate from an Angular CLI** project to Nx! Learn more [here](/recipes/adopting-nx/migration-angular).
|
||||
You can easily and mostly **automatically migrate from an Angular CLI** project to Nx! Learn
|
||||
more [here](/recipes/adopting-nx/migration-angular).
|
||||
{% /callout %}
|
||||
|
||||
## Setting up the Angular plugin
|
||||
@ -79,7 +81,9 @@ Read more about:
|
||||
|
||||
### Fallback to `@schematics/angular`
|
||||
|
||||
If you try to invoke a generator that is not present in `@nrwl/angular`, the request will automatically be forwarded on to `@schematics/angular`. So, even though there is no `@nrwl/angular:service` generator, the following command will successfully create a service:
|
||||
If you try to invoke a generator that is not present in `@nrwl/angular`, the request will automatically be forwarded on
|
||||
to `@schematics/angular`. So, even though there is no `@nrwl/angular:service` generator, the following command will
|
||||
successfully create a service:
|
||||
|
||||
```shell
|
||||
nx g @nrwl/angular:service my-service
|
||||
|
||||
@ -102,8 +102,8 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests. The `protractor` option is deprecated and it will be removed in v15.",
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests.",
|
||||
"default": "cypress"
|
||||
},
|
||||
"tags": {
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests.",
|
||||
"default": "cypress"
|
||||
},
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (e2e) tests.",
|
||||
"default": "cypress",
|
||||
"x-priority": "important"
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests.",
|
||||
"default": "cypress"
|
||||
},
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides:
|
||||
The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries
|
||||
within an Nx workspace. It provides:
|
||||
|
||||
- Integration with libraries such as Storybook, Jest, Cypress, Karma, and Protractor.
|
||||
- Integration with libraries such as Storybook, Jest and Cypress.
|
||||
- Generators to help scaffold code quickly, including:
|
||||
- Micro Frontends
|
||||
- Libraries, both internal to your codebase and publishable to npm
|
||||
@ -10,7 +11,8 @@ The Nx Plugin for Angular contains executors, generators, and utilities for mana
|
||||
- Utilities for automatic workspace refactoring.
|
||||
|
||||
{% callout type="note" title="Currently using the Angular CLI?" %}
|
||||
You can easily and mostly **automatically migrate from an Angular CLI** project to Nx! Learn more [here](/recipes/adopting-nx/migration-angular).
|
||||
You can easily and mostly **automatically migrate from an Angular CLI** project to Nx! Learn
|
||||
more [here](/recipes/adopting-nx/migration-angular).
|
||||
{% /callout %}
|
||||
|
||||
## Setting up the Angular plugin
|
||||
@ -79,7 +81,9 @@ Read more about:
|
||||
|
||||
### Fallback to `@schematics/angular`
|
||||
|
||||
If you try to invoke a generator that is not present in `@nrwl/angular`, the request will automatically be forwarded on to `@schematics/angular`. So, even though there is no `@nrwl/angular:service` generator, the following command will successfully create a service:
|
||||
If you try to invoke a generator that is not present in `@nrwl/angular`, the request will automatically be forwarded on
|
||||
to `@schematics/angular`. So, even though there is no `@nrwl/angular:service` generator, the following command will
|
||||
successfully create a service:
|
||||
|
||||
```shell
|
||||
nx g @nrwl/angular:service my-service
|
||||
|
||||
@ -209,7 +209,6 @@
|
||||
"prettier": "^2.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.1.5",
|
||||
"pretty-quick": "^3.1.0",
|
||||
"protractor": "5.4.3",
|
||||
"raw-loader": "^4.0.2",
|
||||
"react-redux": "8.0.5",
|
||||
"react-refresh": "^0.10.0",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "@nrwl/angular",
|
||||
"version": "0.0.1",
|
||||
"private": false,
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
|
||||
@ -1,22 +1,11 @@
|
||||
import type { Tree } from '@nrwl/devkit';
|
||||
import { getWorkspaceLayout, joinPathFragments } from '@nrwl/devkit';
|
||||
import type { NormalizedSchema } from './normalized-schema';
|
||||
|
||||
import { cypressProjectGenerator } from '@nrwl/cypress';
|
||||
|
||||
import { E2eTestRunner } from '../../../../utils/test-runners';
|
||||
|
||||
import { addProtractor } from './add-protractor';
|
||||
import { removeScaffoldedE2e } from './remove-scaffolded-e2e';
|
||||
import { updateE2eProject } from './update-e2e-project';
|
||||
import { Linter, lintProjectGenerator } from '@nrwl/linter';
|
||||
|
||||
export async function addE2e(tree: Tree, options: NormalizedSchema) {
|
||||
if (options.e2eTestRunner === E2eTestRunner.Protractor) {
|
||||
await addProtractor(tree, options);
|
||||
} else {
|
||||
removeScaffoldedE2e(tree, options, options.ngCliSchematicE2ERoot);
|
||||
}
|
||||
removeScaffoldedE2e(tree, options, options.ngCliSchematicE2ERoot);
|
||||
|
||||
if (options.e2eTestRunner === 'cypress') {
|
||||
await cypressProjectGenerator(tree, {
|
||||
@ -30,21 +19,4 @@ export async function addE2e(tree: Tree, options: NormalizedSchema) {
|
||||
rootProject: options.rootProject,
|
||||
});
|
||||
}
|
||||
|
||||
if (options.e2eTestRunner === E2eTestRunner.Protractor) {
|
||||
updateE2eProject(tree, options);
|
||||
if (options.linter === Linter.EsLint) {
|
||||
await lintProjectGenerator(tree, {
|
||||
project: options.e2eProjectName,
|
||||
linter: options.linter,
|
||||
eslintFilePatterns: [
|
||||
joinPathFragments(options.e2eProjectRoot, '**/*.ts'),
|
||||
],
|
||||
unitTestRunner: options.unitTestRunner,
|
||||
skipFormat: true,
|
||||
setParserOptionsProject: options.setParserOptionsProject,
|
||||
skipPackageJson: options.skipPackageJson,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
import type { Tree } from '@nrwl/devkit';
|
||||
import { joinPathFragments, moveFilesToNewDirectory } from '@nrwl/devkit';
|
||||
import type { NormalizedSchema } from './normalized-schema';
|
||||
|
||||
export async function addProtractor(host: Tree, options: NormalizedSchema) {
|
||||
const { wrapAngularDevkitSchematic } = require('@nrwl/devkit/ngcli-adapter');
|
||||
const protractorSchematic = wrapAngularDevkitSchematic(
|
||||
'@schematics/angular',
|
||||
'e2e'
|
||||
);
|
||||
|
||||
await protractorSchematic(host, {
|
||||
relatedAppName: options.name,
|
||||
rootSelector: `${options.prefix}-root`,
|
||||
});
|
||||
|
||||
moveFilesToNewDirectory(
|
||||
host,
|
||||
joinPathFragments(options.appProjectRoot, 'e2e'),
|
||||
options.e2eProjectRoot
|
||||
);
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
export * from './add-e2e';
|
||||
export * from './add-linting';
|
||||
export * from './add-protractor';
|
||||
export * from './add-proxy-config';
|
||||
export * from './add-unit-test-runner';
|
||||
export * from './create-files';
|
||||
|
||||
@ -1,23 +1,11 @@
|
||||
import type { Tree } from '@nrwl/devkit';
|
||||
import { joinPathFragments } from '@nrwl/devkit';
|
||||
import type { NormalizedSchema } from './normalized-schema';
|
||||
|
||||
import { cypressProjectGenerator } from '@nrwl/cypress';
|
||||
|
||||
import { E2eTestRunner } from '../../../utils/test-runners';
|
||||
|
||||
import { addProtractor } from './add-protractor';
|
||||
import { removeScaffoldedE2e } from './remove-scaffolded-e2e';
|
||||
import { updateE2eProject } from './update-e2e-project';
|
||||
import { Linter, lintProjectGenerator } from '@nrwl/linter';
|
||||
|
||||
export async function addE2e(tree: Tree, options: NormalizedSchema) {
|
||||
if (options.e2eTestRunner === E2eTestRunner.Protractor) {
|
||||
await addProtractor(tree, options);
|
||||
} else {
|
||||
removeScaffoldedE2e(tree, options, options.ngCliSchematicE2ERoot);
|
||||
}
|
||||
|
||||
removeScaffoldedE2e(tree, options, options.ngCliSchematicE2ERoot);
|
||||
if (options.e2eTestRunner === 'cypress') {
|
||||
await cypressProjectGenerator(tree, {
|
||||
name: options.e2eProjectName,
|
||||
@ -30,21 +18,4 @@ export async function addE2e(tree: Tree, options: NormalizedSchema) {
|
||||
rootProject: options.rootProject,
|
||||
});
|
||||
}
|
||||
|
||||
if (options.e2eTestRunner === E2eTestRunner.Protractor) {
|
||||
updateE2eProject(tree, options);
|
||||
if (options.linter === Linter.EsLint) {
|
||||
await lintProjectGenerator(tree, {
|
||||
project: options.e2eProjectName,
|
||||
linter: options.linter,
|
||||
eslintFilePatterns: [
|
||||
joinPathFragments(options.e2eProjectRoot, '**/*.ts'),
|
||||
],
|
||||
unitTestRunner: options.unitTestRunner,
|
||||
skipFormat: true,
|
||||
setParserOptionsProject: options.setParserOptionsProject,
|
||||
skipPackageJson: options.skipPackageJson,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
import type { Tree } from '@nrwl/devkit';
|
||||
import { joinPathFragments, moveFilesToNewDirectory } from '@nrwl/devkit';
|
||||
import type { NormalizedSchema } from './normalized-schema';
|
||||
|
||||
export async function addProtractor(host: Tree, options: NormalizedSchema) {
|
||||
const { wrapAngularDevkitSchematic } = require('@nrwl/devkit/ngcli-adapter');
|
||||
const protractorSchematic = wrapAngularDevkitSchematic(
|
||||
'@schematics/angular',
|
||||
'e2e'
|
||||
);
|
||||
|
||||
await protractorSchematic(host, {
|
||||
relatedAppName: options.name,
|
||||
rootSelector: `${options.prefix}-root`,
|
||||
});
|
||||
|
||||
moveFilesToNewDirectory(
|
||||
host,
|
||||
joinPathFragments(options.appProjectRoot, 'e2e'),
|
||||
options.e2eProjectRoot
|
||||
);
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
export * from './add-e2e';
|
||||
export * from './add-linting';
|
||||
export * from './add-protractor';
|
||||
export * from './add-proxy-config';
|
||||
export * from './add-unit-test-runner';
|
||||
export * from './create-files';
|
||||
|
||||
@ -105,8 +105,8 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests. The `protractor` option is deprecated and it will be removed in v15.",
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests.",
|
||||
"default": "cypress"
|
||||
},
|
||||
"tags": {
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests.",
|
||||
"default": "cypress"
|
||||
},
|
||||
|
||||
@ -183,27 +183,6 @@ async function addE2ETestRunner(
|
||||
options: Schema
|
||||
): Promise<GeneratorCallback> {
|
||||
switch (options.e2eTestRunner) {
|
||||
case E2eTestRunner.Protractor:
|
||||
return !options.skipPackageJson
|
||||
? addDependenciesToPackageJsonIfDontExist(
|
||||
tree,
|
||||
{},
|
||||
{
|
||||
protractor:
|
||||
backwardCompatibleVersions.angularV14.protractorVersion,
|
||||
'jasmine-core':
|
||||
backwardCompatibleVersions.angularV14.jasmineCoreVersion,
|
||||
'jasmine-spec-reporter':
|
||||
backwardCompatibleVersions.angularV14
|
||||
.jasmineSpecReporterVersion,
|
||||
'ts-node': backwardCompatibleVersions.angularV14.tsNodeVersion,
|
||||
'@types/jasmine':
|
||||
backwardCompatibleVersions.angularV14.typesJasmineVersion,
|
||||
'@types/jasminewd2':
|
||||
backwardCompatibleVersions.angularV14.typesJasminewd2Version,
|
||||
}
|
||||
)
|
||||
: () => {};
|
||||
case E2eTestRunner.Cypress:
|
||||
return await cypressInitGenerator(tree, {
|
||||
skipPackageJson: options.skipPackageJson,
|
||||
|
||||
@ -198,44 +198,6 @@ describe('init', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('protractor', () => {
|
||||
it('should add protractor dependencies', async () => {
|
||||
// ACT
|
||||
await init(tree, {
|
||||
unitTestRunner: UnitTestRunner.None,
|
||||
e2eTestRunner: E2eTestRunner.Protractor,
|
||||
linter: Linter.EsLint,
|
||||
skipFormat: false,
|
||||
});
|
||||
|
||||
const { devDependencies } = readJson(tree, 'package.json');
|
||||
|
||||
// ASSERT
|
||||
expect(devDependencies['protractor']).toBeDefined();
|
||||
expect(devDependencies['jasmine-core']).toBeDefined();
|
||||
expect(devDependencies['jasmine-spec-reporter']).toBeDefined();
|
||||
expect(devDependencies['@types/jasmine']).toBeDefined();
|
||||
expect(devDependencies['@types/jasminewd2']).toBeDefined();
|
||||
});
|
||||
|
||||
it('should set defaults', async () => {
|
||||
// ACT
|
||||
await init(tree, {
|
||||
unitTestRunner: UnitTestRunner.None,
|
||||
e2eTestRunner: E2eTestRunner.Protractor,
|
||||
linter: Linter.EsLint,
|
||||
skipFormat: false,
|
||||
});
|
||||
|
||||
const { generators } = readJson<NxJsonConfiguration>(tree, 'nx.json');
|
||||
|
||||
// ASSERT
|
||||
expect(generators['@nrwl/angular:application'].e2eTestRunner).toEqual(
|
||||
'protractor'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('--linter', () => {
|
||||
@ -528,54 +490,6 @@ bar
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('protractor', () => {
|
||||
it('should add protractor dependencies', async () => {
|
||||
// ACT
|
||||
await init(tree, {
|
||||
unitTestRunner: UnitTestRunner.None,
|
||||
e2eTestRunner: E2eTestRunner.Protractor,
|
||||
linter: Linter.EsLint,
|
||||
skipFormat: false,
|
||||
});
|
||||
|
||||
const { devDependencies } = readJson(tree, 'package.json');
|
||||
|
||||
// ASSERT
|
||||
expect(devDependencies['protractor']).toEqual(
|
||||
backwardCompatibleVersions.angularV14.protractorVersion
|
||||
);
|
||||
expect(devDependencies['jasmine-core']).toEqual(
|
||||
backwardCompatibleVersions.angularV14.jasmineCoreVersion
|
||||
);
|
||||
expect(devDependencies['jasmine-spec-reporter']).toEqual(
|
||||
backwardCompatibleVersions.angularV14.jasmineSpecReporterVersion
|
||||
);
|
||||
expect(devDependencies['@types/jasmine']).toEqual(
|
||||
backwardCompatibleVersions.angularV14.typesJasmineVersion
|
||||
);
|
||||
expect(devDependencies['@types/jasminewd2']).toEqual(
|
||||
backwardCompatibleVersions.angularV14.typesJasminewd2Version
|
||||
);
|
||||
});
|
||||
|
||||
it('should set defaults', async () => {
|
||||
// ACT
|
||||
await init(tree, {
|
||||
unitTestRunner: UnitTestRunner.None,
|
||||
e2eTestRunner: E2eTestRunner.Protractor,
|
||||
linter: Linter.EsLint,
|
||||
skipFormat: false,
|
||||
});
|
||||
|
||||
const { generators } = readJson<NxJsonConfiguration>(tree, 'nx.json');
|
||||
|
||||
// ASSERT
|
||||
expect(generators['@nrwl/angular:application'].e2eTestRunner).toEqual(
|
||||
'protractor'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('--linter', () => {
|
||||
|
||||
@ -19,15 +19,9 @@ import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
|
||||
import {
|
||||
angularDevkitVersion,
|
||||
angularVersion,
|
||||
jasmineCoreVersion,
|
||||
jasmineSpecReporterVersion,
|
||||
jestPresetAngularVersion,
|
||||
protractorVersion,
|
||||
rxjsVersion,
|
||||
tsLibVersion,
|
||||
tsNodeVersion,
|
||||
typesJasmineVersion,
|
||||
typesJasminewd2Version,
|
||||
zoneJsVersion,
|
||||
} from '../../utils/versions';
|
||||
import {
|
||||
@ -205,21 +199,6 @@ async function addE2ETestRunner(
|
||||
options: Schema
|
||||
): Promise<GeneratorCallback> {
|
||||
switch (options.e2eTestRunner) {
|
||||
case E2eTestRunner.Protractor:
|
||||
return !options.skipPackageJson
|
||||
? addDependenciesToPackageJsonIfDontExist(
|
||||
tree,
|
||||
{},
|
||||
{
|
||||
protractor: protractorVersion,
|
||||
'jasmine-core': jasmineCoreVersion,
|
||||
'jasmine-spec-reporter': jasmineSpecReporterVersion,
|
||||
'ts-node': tsNodeVersion,
|
||||
'@types/jasmine': typesJasmineVersion,
|
||||
'@types/jasminewd2': typesJasminewd2Version,
|
||||
}
|
||||
)
|
||||
: () => {};
|
||||
case E2eTestRunner.Cypress:
|
||||
return cypressInitGenerator(tree, {
|
||||
skipPackageJson: options.skipPackageJson,
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (e2e) tests.",
|
||||
"default": "cypress",
|
||||
"x-priority": "important"
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["protractor", "cypress", "none"],
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (E2E) tests.",
|
||||
"default": "cypress"
|
||||
},
|
||||
|
||||
@ -35,11 +35,6 @@ export const backwardCompatibleVersions: Record<
|
||||
autoprefixerVersion: '^10.4.0',
|
||||
tsNodeVersion: '10.9.1',
|
||||
jestPresetAngularVersion: '~12.2.3',
|
||||
protractorVersion: '~7.0.0',
|
||||
jasmineCoreVersion: '~4.2.0',
|
||||
jasmineSpecReporterVersion: '~7.0.0',
|
||||
typesJasmineVersion: '~4.0.0',
|
||||
typesJasminewd2Version: '~2.0.3',
|
||||
typesNodeVersion: '16.11.7',
|
||||
jasmineMarblesVersion: '^0.9.2',
|
||||
},
|
||||
|
||||
@ -4,11 +4,6 @@ export enum UnitTestRunner {
|
||||
}
|
||||
|
||||
export enum E2eTestRunner {
|
||||
/**
|
||||
* @deprecated Protractor is no longer maintained. Support for generating
|
||||
* E2E tests with it will be removed in v15.
|
||||
*/
|
||||
Protractor = 'protractor',
|
||||
Cypress = 'cypress',
|
||||
None = 'none',
|
||||
}
|
||||
|
||||
@ -26,10 +26,5 @@ export const autoprefixerVersion = '^10.4.0';
|
||||
export const tsNodeVersion = '10.9.1';
|
||||
|
||||
export const jestPresetAngularVersion = '~13.0.0';
|
||||
export const protractorVersion = '~7.0.0';
|
||||
export const jasmineCoreVersion = '~4.2.0';
|
||||
export const jasmineSpecReporterVersion = '~7.0.0';
|
||||
export const typesJasmineVersion = '~4.0.0';
|
||||
export const typesJasminewd2Version = '~2.0.3';
|
||||
export const typesNodeVersion = '16.11.7';
|
||||
export const jasmineMarblesVersion = '^0.9.2';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user