Skip to content

Commit

Permalink
feat(repo): run e2e tests using nx
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Jun 8, 2020
1 parent 539c65c commit e71ceba
Show file tree
Hide file tree
Showing 112 changed files with 1,071 additions and 490 deletions.
69 changes: 34 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ commands:
- save_cache:
key: nrwl-nx-node12-cypress-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/Cypress
- ~/.cache/Cypre ss
restore_cypress_cache:
description: 'Restore Cypress Cache'
steps:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- setup
- run:
name: Run Unit Tests
command: yarn test
command: NX_VERBOSE_LOGGING=true yarn test
- run:
name: Check Documentation
command: yarn documentation
Expand All @@ -92,71 +92,70 @@ jobs:
- run:
name: Check Commit Message Format
command: yarn checkcommit
e2e-nx-1:
e2e-1:
executor: default
steps:
- setup
- run:
name: Nx CLI E2E Tests Part 1
command: yarn e2e-ci1 nx
name: Tests Part 1
command: yarn e2e-ci 1
no_output_timeout: 30m
e2e-nx-2:
e2e-2:
executor: default
steps:
- setup
- run:
name: Nx CLI E2E Tests Part 2
command: yarn e2e-ci2 nx
name: Tests Part 2
command: yarn e2e-ci 2
no_output_timeout: 30m
e2e-nx-3:
e2e-3:
executor: default
steps:
- setup
- run:
name: Nx CLI E2E Tests Part 3
command: yarn e2e-ci3 nx
name: Tests Part 3
command: yarn e2e-ci 3
no_output_timeout: 30m
e2e-nx-4:
e2e-4:
executor: default
steps:
- setup
- run:
name: Nx CLI E2E Tests Part 4
command: yarn e2e-ci4 nx
name: Tests Part 4
command: yarn e2e-ci 4
no_output_timeout: 30m
e2e-ng-1:
e2e-5:
executor: default
steps:
- setup
- run:
name: Angular CLI E2E Tests Part 1
command: yarn e2e-ci1 angular
name: Tests Part 5
command: yarn e2e-ci 5
no_output_timeout: 30m
e2e-ng-2:
e2e-6:
executor: default
steps:
- setup
- run:
name: Angular CLI E2E Tests Part 2
command: yarn e2e-ci2 angular
name: Tests Part 6
command: yarn e2e-ci 6
no_output_timeout: 30m
e2e-ng-3:
e2e-7:
executor: default
steps:
- setup
- run:
name: Angular CLI E2E Tests Part 3
command: yarn e2e-ci3 angular
name: Tests Part 7
command: yarn e2e-ci 7
no_output_timeout: 30m
e2e-ng-4:
e2e-8:
executor: default
steps:
- setup
- run:
name: Angular CLI E2E Tests Part 4
command: yarn e2e-ci4 angular
name: Tests Part 8
command: yarn e2e-ci 8
no_output_timeout: 30m

workflows:
version: 2.1
default_workflow:
Expand All @@ -165,27 +164,27 @@ workflows:
- checks-and-unit-tests:
requires:
- install
- e2e-nx-1:
- e2e-1:
requires:
- install
- e2e-nx-2:
- e2e-2:
requires:
- install
- e2e-nx-3:
- e2e-3:
requires:
- install
- e2e-nx-4:
- e2e-4:
requires:
- install
- e2e-ng-1:
- e2e-5:
requires:
- install
- e2e-ng-2:
- e2e-6:
requires:
- install
- e2e-ng-3:
- e2e-7:
requires:
- install
- e2e-ng-4:
- e2e-8:
requires:
- install
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ tmp
.ng_pkg_build
jest.debug.config.js
.tool-versions
/.verdaccio/build/local-registry
/.verdaccio/build/local-registry
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ packages/jest/src/schematics/**/files/**/*.json
/.github
/coverage
/.yarn
/.verdaccio/build/local-registry
/.verdaccio/build/local-registry
/dist
9 changes: 9 additions & 0 deletions e2e/angular/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
name: 'angular',
preset: '../../jest.config.js',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
maxWorkers: 1,
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
runCLI,
uniq,
updateFile,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli('angular', (cli) => {
describe('Build Angular library', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/angular.test.ts → e2e/angular/src/angular.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
checkFilesExist,
tmpProjPath,
supportUi,
} from './utils';
} from '@nrwl/e2e/utils';
import { toClassName } from '@nrwl/workspace';

forEachCli(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
forEachCli,
supportUi,
patchKarmaToWorkOnWSL,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli('angular', () => {
describe('DowngradeModule', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/karma.test.ts → e2e/angular/src/karma.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
runCLI,
runCLIAsync,
uniq,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli(() => {
describe('Karma', () => {
Expand Down
5 changes: 3 additions & 2 deletions e2e/ng-add.test.ts → e2e/angular/src/ng-add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
updateFile,
forEachCli,
runNgAdd,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli('angular', () => {
describe('Nrwl Convert to Nx Workspace', () => {
Expand Down Expand Up @@ -70,7 +70,7 @@ forEachCli('angular', () => {
const updatedPackageJson = readJson('package.json');
expect(updatedPackageJson.description).toEqual('some description');
expect(updatedPackageJson.scripts).toEqual({
ng: 'ng',
ng: 'nx',
nx: 'nx',
start: 'ng serve',
build: 'ng build',
Expand All @@ -90,6 +90,7 @@ forEachCli('angular', () => {
'format:check': 'nx format:check',
update: 'ng update @nrwl/workspace',
'update:check': 'ng update',
postinstall: 'node ./decorate-angular-cli.js',
'dep-graph': 'nx dep-graph',
'workspace-schematic': 'nx workspace-schematic',
help: 'nx help',
Expand Down
2 changes: 1 addition & 1 deletion e2e/ngrx.test.ts → e2e/angular/src/ngrx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ensureProject,
readJson,
forEachCli,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli(() => {
describe('ngrx', () => {
Expand Down
9 changes: 7 additions & 2 deletions e2e/protractor.test.ts → e2e/angular/src/protractor.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { ensureProject, runCLI, uniq, forEachCli } from './utils';
import { toClassName } from '@nrwl/workspace';
import { ensureProject, runCLI, uniq, forEachCli } from '@nrwl/e2e/utils';

forEachCli(() => {
describe('Protractor', () => {
it('empty test', () => {
expect(1).toEqual(1);
});
});

xdescribe('Protractor', () => {
beforeEach(() => {
ensureProject();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
forEachCli,
supportUi,
patchKarmaToWorkOnWSL,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli('angular', () => {
describe('Upgrade', () => {
Expand Down
7 changes: 7 additions & 0 deletions e2e/angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
15 changes: 15 additions & 0 deletions e2e/angular/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.d.ts"
]
}
9 changes: 9 additions & 0 deletions e2e/bazel/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
name: 'bazel',
preset: '../../jest.config.js',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
maxWorkers: 1,
};
2 changes: 1 addition & 1 deletion e2e/bazel.test.ts → e2e/bazel/src/bazel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
runCommand,
uniq,
updateFile,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli((currentCLIName) => {
describe('Bazel', () => {
Expand Down
7 changes: 7 additions & 0 deletions e2e/bazel/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
15 changes: 15 additions & 0 deletions e2e/bazel/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.d.ts"
]
}
9 changes: 9 additions & 0 deletions e2e/cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
name: 'cli',
preset: '../../jest.config.js',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
maxWorkers: 1,
};
4 changes: 2 additions & 2 deletions e2e/cli.test.ts → e2e/cli/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
tmpProjPath,
uniq,
updateFile,
} from './utils';
} from '@nrwl/e2e/utils';

forEachCli('nx', () => {
describe('Help', () => {
fit('should show help', async () => {
it('should show help', async () => {
ensureProject();
const myapp = uniq('myapp');
runCLI(`generate @nrwl/web:app ${myapp}`);
Expand Down
7 changes: 7 additions & 0 deletions e2e/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
15 changes: 15 additions & 0 deletions e2e/cli/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.d.ts"
]
}
1 change: 0 additions & 1 deletion e2e/commands/README

This file was deleted.

Loading

0 comments on commit e71ceba

Please sign in to comment.