Skip to content

Commit

Permalink
feat: angular 10 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: A10

closes #148, #149
  • Loading branch information
satanTime committed Jul 4, 2020
1 parent 466d5ca commit 2e82aa5
Show file tree
Hide file tree
Showing 380 changed files with 134,170 additions and 388 deletions.
20 changes: 14 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/coverage
/dist
/node_modules
/e2e/angular5/node_modules
/e2e/angular6/node_modules
/e2e/angular7/node_modules
/e2e/angular8/node_modules
/e2e/angular9-ivy-false/node_modules
/e2e/angular9-ivy-true/node_modules
/e2e/a5es5/node_modules
/e2e/a5es2015/node_modules
/e2e/a6es5/node_modules
/e2e/a6es2015/node_modules
/e2e/a7es5/node_modules
/e2e/a7es2015/node_modules
/e2e/a8es5/node_modules
/e2e/a8es2015/node_modules
/e2e/a9es5ivy/node_modules
/e2e/a9es5noivy/node_modules
/e2e/a9es2015ivy/node_modules
/e2e/a9es2015noivy/node_modules
/e2e/a10es2015ivy/node_modules
/e2e/a10es2015noivy/node_modules
160 changes: 148 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,155 @@ addons:
chrome: stable
git:
autocrlf: false
install:
- npm install
script:
- npm run test:angular-versions
jobs:
include:
- name: 'Unit Tests'
install:
- npm install
script:
- npm run test:angular-versions
- name: 'Angular 5 es5'
install:
- npm install
- npm run build
- npm run i:a5es5
script:
- npm run s:a5es5
- npm run s:test:a5es5
- npm run test:a5es5
- npm run clear:a5es5
- name: 'Angular 5 es2015'
install:
- npm install
- npm run build
- npm run i:a5es2015
script:
- npm run s:a5es2015
- npm run s:test:a5es2015
- npm run test:a5es2015
- npm run clear:a5es2015
- name: 'Angular 6 es5'
install:
- npm install
- npm run build
- npm run i:a6es5
script:
- npm run s:a6es5
- npm run s:test:a6es5
- npm run test:a6es5
- npm run clear:a6es5
- name: 'Angular 6 es2015'
install:
- npm install
- npm run build
- npm run i:a6es2015
script:
- npm run s:a6es2015
- npm run s:test:a6es2015
- npm run test:a6es2015
- npm run clear:a6es2015
- name: 'Angular 7 es5'
install:
- npm install
- npm run build
- npm run i:a7es5
script:
- npm run s:a7es5
- npm run s:test:a7es5
- npm run test:a7es5
- npm run clear:a7es5
- name: 'Angular 7 es2015'
install:
- npm install
- npm run build
- npm run i:a7es2015
script:
- npm run s:a7es2015
- npm run s:test:a7es2015
- npm run test:a7es2015
- npm run clear:a7es2015
- name: 'Angular 8 es5'
install:
- npm install
- npm run build
- npm run i:a8es5
script:
- npm run s:a8es5
- npm run s:test:a8es5
- npm run test:a8es5
- npm run clear:a8es5
- name: 'Angular 8 es2015'
install:
- npm install
- npm run build
- npm run i:a8es2015
script:
- npm run s:a8es2015
- npm run s:test:a8es2015
- npm run test:a8es2015
- npm run clear:a8es2015
- name: 'Angular 9 es5 w/ Ivy'
install:
- npm install
- npm run build
- npm run i:a9es5ivy
script:
- npm run s:a9es5ivy
- npm run s:test:a9es5ivy
- npm run test:a9es5ivy
- npm run clear:a9es5ivy
- name: 'Angular 9 es5 w/o Ivy'
install:
- npm install
- npm run build
- npm run i:a9es5noivy
script:
- npm run s:a9es5noivy
- npm run s:test:a9es5noivy
- npm run test:a9es5noivy
- npm run clear:a9es5noivy
- name: 'Angular 9 es2015 w/ Ivy'
install:
- npm install
- npm run build
- npm run i:a9es2015ivy
script:
- npm run s:a9es2015ivy
- npm run s:test:a9es2015ivy
- npm run test:a9es2015ivy
- npm run clear:a9es2015ivy
- name: 'Angular 9 es2015 w/o Ivy'
install:
- npm install
- npm run build
- npm run i:a9es2015noivy
script:
- npm run s:a9es2015noivy
- npm run s:test:a9es2015noivy
- npm run test:a9es2015noivy
- npm run clear:a9es2015noivy
- name: 'Angular 10 es2015 w/ Ivy'
install:
- npm install
- npm run build
- npm run i:a10es2015ivy
script:
- npm run s:a10es2015ivy
- npm run s:test:a10es2015ivy
- npm run test:a10es2015ivy
- npm run clear:a10es2015ivy
- name: 'Angular 10 es2015 w/o Ivy'
install:
- npm install
- npm run build
- npm run i:a10es2015noivy
script:
- npm run s:a10es2015noivy
- npm run s:test:a10es2015noivy
- npm run test:a10es2015noivy
- npm run clear:a10es2015noivy
cache:
npm: false
npm: true
directories:
- $HOME/.npm
- $HOME/.node-gyp
- node_modules
- e2e/angular5/node_modules
- e2e/angular6/node_modules
- e2e/angular7/node_modules
- e2e/angular8/node_modules
- e2e/angular9-ivy-false/node_modules
- e2e/angular9-ivy-true/node_modules
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ CMD ["sh", "build-with-supported-angluars.sh"]

VOLUME /npm
VOLUME /app/node_modules
VOLUME /app/e2e/angular5/node_modules
VOLUME /app/e2e/angular6/node_modules
VOLUME /app/e2e/angular7/node_modules
VOLUME /app/e2e/angular8/node_modules
VOLUME /app/e2e/angular9-ivy-false/node_modules
VOLUME /app/e2e/angular9-ivy-true/node_modules
VOLUME /app/e2e/a5es5/node_modules
VOLUME /app/e2e/a5es2015/node_modules
VOLUME /app/e2e/a6es5/node_modules
VOLUME /app/e2e/a6es2015/node_modules
VOLUME /app/e2e/a7es5/node_modules
VOLUME /app/e2e/a7es2015/node_modules
VOLUME /app/e2e/a8es5/node_modules
VOLUME /app/e2e/a8es2015/node_modules
VOLUME /app/e2e/a9es5ivy/node_modules
VOLUME /app/e2e/a9es5noivy/node_modules
VOLUME /app/e2e/a9es2015ivy/node_modules
VOLUME /app/e2e/a9es2015noivy/node_modules
VOLUME /app/e2e/a10es2015ivy/node_modules
VOLUME /app/e2e/a10es2015noivy/node_modules

RUN npm config set cache /npm --global

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Helper function for creating angular mocks for test.

Tested on:

- Angular 5 (Jasmine, Jest)
- Angular 6 (Jasmine, Jest)
- Angular 7 (Jasmine, Jest)
- Angular 8 (Jasmine, Jest)
- Angular 9 (Jasmine, Jest, Ivy)
- Angular 5 (Jasmine, Jest, es5, es2015)
- Angular 6 (Jasmine, Jest, es5, es2015)
- Angular 7 (Jasmine, Jest, es5, es2015)
- Angular 8 (Jasmine, Jest, es5, es2015)
- Angular 9 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 10 (Jasmine, Jest, Ivy, es2015)

## Why use this?

Expand Down Expand Up @@ -147,6 +148,8 @@ Our tests:
- [Structural Components](#usage-example-of-structural-directives)
- [Auto Spy](#auto-spy)

* [Troubleshooting](#troubleshooting)

---

## MockComponent(s)
Expand Down
14 changes: 7 additions & 7 deletions build-with-supported-angluars.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
VERSIONS="5 6 7 8 9"
VERSIONS="5 6 7 8 9 10"
PACKAGES="animations common compiler core forms platform-browser platform-browser-dynamic router"

for version in $VERSIONS
Expand All @@ -14,11 +14,12 @@ do
NEW="$NEW @angular/$package@$version"
done

echo $version | grep -Eq "^5" && NEW="$NEW rxjs@5.5.5 zone.js@0.8.14 typescript@2.4"
echo $version | grep -Eq "^6" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@2.7"
echo $version | grep -Eq "^7" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@3.1"
echo $version | grep -Eq "^8" && NEW="$NEW rxjs@6.4.0 zone.js@0.9.1 typescript@3.4.3"
echo $version | grep -Eq "^9" && NEW="$NEW rxjs@6.5.3 zone.js@0.10.2 typescript@3.6.4"
echo $version | grep -Eq "^5$" && NEW="$NEW rxjs@5.5.5 zone.js@0.8.14 typescript@2.4"
echo $version | grep -Eq "^6$" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@2.7"
echo $version | grep -Eq "^7$" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@3.1"
echo $version | grep -Eq "^8$" && NEW="$NEW rxjs@6.4.0 zone.js@0.9.1 typescript@3.4.3"
echo $version | grep -Eq "^9$" && NEW="$NEW rxjs@6.5.3 zone.js@0.10.2 typescript@3.6.4"
echo $version | grep -Eq "^10$" && NEW="$NEW rxjs@6.5.5 zone.js@0.10.3 typescript@3.9.5"

echo $NEW

Expand All @@ -27,5 +28,4 @@ do
npm run build:all
done
npm install --silent --quiet --no-progress
npm run e2e
echo Testing complete
17 changes: 17 additions & 0 deletions e2e/a10es2015ivy/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

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

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
File renamed without changes.
File renamed without changes.
101 changes: 101 additions & 0 deletions e2e/a10es2015ivy/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"a10es2015ivy": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/a10es2015ivy",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "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": "a10es2015ivy:build"
},
"configurations": {
"production": {
"browserTarget": "a10es2015ivy:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "a10es2015ivy:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"defaultProject": "a10es2015ivy"
}
Loading

0 comments on commit 2e82aa5

Please sign in to comment.