Skip to content

Commit

Permalink
chore(e2e): add nrwl-nx to e2e external test cases (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored Apr 10, 2020
1 parent 406a4cf commit 232c458
Show file tree
Hide file tree
Showing 63 changed files with 22,053 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- npm i -g yarn
script:
- npm run clean -- --when-ci-commit-message
- npm run test:monorepo
- npm run test:external-repos
- os: linux
node_js: 10
env: TS_JEST_E2E_WORKDIR=/tmp/ts-jest-e2e-workdir TS_JEST_E2E_OPTIMIZATIONS=1
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- npm run clean -- --when-ci-commit-message
# only grab coverage data on node 10
- npm run test -- --runInBand --coverage
- npm run test:monorepo
- npm run test:external-repos
after_success:
# report coverages to coveralls
- if [[ -s coverage/lcov.info ]]; then cat coverage/lcov.info | coveralls; fi
28 changes: 28 additions & 0 deletions e2e/__external-repos__/nrwl-nx/.debug/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
rootDir: '../',
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.html?$',
tsConfig: '<rootDir>/.debug/tsconfig.spec.json',
astTransformers: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer'
]
}
},
testEnvironment: 'jest-environment-jsdom-sixteen',
preset: 'jest-preset-angular',
testURL: 'http://localhost/',
transform: {
'^.+\\.(ts|html)$': 'ts-jest'
},
setupFilesAfterEnv: ['<rootDir>/.debug/test-setup.ts'],
silent: false,
transformIgnorePatterns: ['node_modules/(?!@ngrx)', '<rootDir>/dist/'],
moduleNameMapper: {
'^@ccxp-client/(.*)$': '<rootDir>/libs/$1/src/index.ts',
'^@ccxp-client-testing/(.*)$': '<rootDir>/libs/$1/src/testing.ts',
'^tools/(.*)$': '<rootDir>/tools/$1',
'\\.svg$': 'identity-obj-proxy'
}
};
1 change: 1 addition & 0 deletions e2e/__external-repos__/nrwl-nx/.debug/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular';
7 changes: 7 additions & 0 deletions e2e/__external-repos__/nrwl-nx/.debug/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["jest", "node"]
}
}
13 changes: 13 additions & 0 deletions e2e/__external-repos__/nrwl-nx/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
39 changes: 39 additions & 0 deletions e2e/__external-repos__/nrwl-nx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions e2e/__external-repos__/nrwl-nx/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
3 changes: 3 additions & 0 deletions e2e/__external-repos__/nrwl-nx/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
84 changes: 84 additions & 0 deletions e2e/__external-repos__/nrwl-nx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# TsjestCannotFindSourceFile

This project was generated using [Nx](https://nx.dev).

<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png" width="450"></p>

🔎 **Nx is a set of Extensible Dev Tools for Monorepos.**

## Quick Start & Documentation

[Nx Documentation](https://nx.dev/angular)

[10-minute video showing all Nx features](https://nx.dev/angular/getting-started/what-is-nx)

[Interactive Tutorial](https://nx.dev/angular/tutorial/01-create-application)

## Adding capabilities to your workspace

Nx supports many plugins which add capabilities for developing different types of applications and different tools.

These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.

Below are some plugins which you can add to your workspace:

- [Angular](https://angular.io)
- `ng add @nrwl/angular`
- [React](https://reactjs.org)
- `ng add @nrwl/react`
- Web (no framework frontends)
- `ng add @nrwl/web`
- [Nest](https://nestjs.com)
- `ng add @nrwl/nest`
- [Express](https://expressjs.com)
- `ng add @nrwl/express`
- [Node](https://nodejs.org)
- `ng add @nrwl/node`

## Generate an application

Run `ng g @nrwl/angular:app my-app` to generate an application.

> You can use any of the plugins above to generate applications as well.
When using Nx, you can create multiple applications and libraries in the same workspace.

## Generate a library

Run `ng g @nrwl/angular:lib my-lib` to generate a library.

> You can also use any of the plugins above to generate libraries as well.
Libraries are sharable across libraries and applications. They can be imported from `@tsjest-cannot-find-source-file/mylib`.

## Development server

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.

## Code scaffolding

Run `ng g component my-component --project=my-app` to generate a new component.

## Build

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.

## Running unit tests

Run `ng test my-app` to execute the unit tests via [Jest](https://jestjs.io).

Run `nx affected:test` to execute the unit tests affected by a change.

## Running end-to-end tests

Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).

Run `nx affected:e2e` to execute the end-to-end tests affected by a change.

## Understand your workspace

Run `nx dep-graph` to see a diagram of the dependencies of your projects.

## Further help

Visit the [Nx Documentation](https://nx.dev/angular) to learn more.
118 changes: 118 additions & 0 deletions e2e/__external-repos__/nrwl-nx/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"version": 1,
"projects": {
"nrwl-nx": {
"projectType": "application",
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
},
"root": "apps/nrwl-nx",
"sourceRoot": "apps/nrwl-nx/src",
"prefix": "nrwl-nx",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/nrwl-nx",
"index": "apps/nrwl-nx/src/index.html",
"main": "apps/nrwl-nx/src/main.ts",
"polyfills": "apps/nrwl-nx/src/polyfills.ts",
"tsConfig": "apps/nrwl-nx/tsconfig.app.json",
"aot": true,
"assets": [
"apps/nrwl-nx/src/favicon.ico",
"apps/nrwl-nx/src/assets"
],
"styles": ["apps/nrwl-nx/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/nrwl-nx/src/environments/environment.ts",
"with": "apps/nrwl-nx/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "nrwl-nx:build"
},
"configurations": {
"production": {
"browserTarget": "nrwl-nx:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "nrwl-nx:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/nrwl-nx/tsconfig.app.json",
"apps/nrwl-nx/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!apps/nrwl-nx/**"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/nrwl-nx/jest.config.js",
"tsConfig": "apps/nrwl-nx/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "apps/nrwl-nx/src/test-setup.ts"
}
}
}
}
},
"cli": {
"defaultCollection": "@nrwl/angular",
"analytics": false
},
"schematics": {
"@nrwl/angular:application": {
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"unitTestRunner": "jest"
}
},
"defaultProject": "nrwl-nx"
}
12 changes: 12 additions & 0 deletions e2e/__external-repos__/nrwl-nx/apps/nrwl-nx/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
10 changes: 10 additions & 0 deletions e2e/__external-repos__/nrwl-nx/apps/nrwl-nx/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
name: 'tsjest-cannot-find-source-file',
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/apps/tsjest-cannot-find-source-file',
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js',
],
}
Loading

0 comments on commit 232c458

Please sign in to comment.