Skip to content

Commit

Permalink
feat: support of A12
Browse files Browse the repository at this point in the history
Closes #293
  • Loading branch information
satanTime committed Feb 12, 2021
1 parent 4449a41 commit 4627fe2
Show file tree
Hide file tree
Showing 33 changed files with 19,541 additions and 12 deletions.
93 changes: 93 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
key: a10-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a10/package-lock.json" }}
- restore_cache:
key: a11-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a11/package-lock.json" }}
- restore_cache:
key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }}
- restore_cache:
key: am-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/am/package-lock.json" }}
- run:
Expand Down Expand Up @@ -114,6 +116,9 @@ jobs:
if [ ! -d "e2e/a11/node_modules/" ]; then
npm run i:ci:a11
fi
if [ ! -d "e2e/a12/node_modules/" ]; then
npm run i:ci:a12
fi
if [ ! -d "e2e/am/node_modules/" ]; then
npm run i:ci:am
fi
Expand Down Expand Up @@ -149,6 +154,10 @@ jobs:
key: a11-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a11/package-lock.json" }}
paths:
- ./e2e/a11/node_modules
- save_cache:
key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }}
paths:
- ./e2e/a12/node_modules
- save_cache:
key: am-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/am/package-lock.json" }}
paths:
Expand Down Expand Up @@ -513,6 +522,78 @@ jobs:
- run:
name: Unit Tests
command: npm run test:a11es2015ivy
'Angular 12 ES5':
docker:
- image: satantime/puppeteer-node:14.15.5-buster
steps:
- checkout
- attach_workspace:
at: dist
- restore_cache:
key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }}
- run:
name: Spreading Build
command: npm run s:a12
- run:
name: Spreading Tests
command: npm run s:test:a12
- run:
name: Unit Tests
command: npm run test:a12es5
'Angular 12 ES2015':
docker:
- image: satantime/puppeteer-node:14.15.5-buster
steps:
- checkout
- attach_workspace:
at: dist
- restore_cache:
key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }}
- run:
name: Spreading Build
command: npm run s:a12
- run:
name: Spreading Tests
command: npm run s:test:a12
- run:
name: Unit Tests
command: npm run test:a12es2015
'Angular 12 ES5 Ivy':
docker:
- image: satantime/puppeteer-node:14.15.5-buster
steps:
- checkout
- attach_workspace:
at: dist
- restore_cache:
key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }}
- run:
name: Spreading Build
command: npm run s:a12
- run:
name: Spreading Tests
command: npm run s:test:a12
- run:
name: Unit Tests
command: npm run test:a12es5ivy
'Angular 12 ES2015 Ivy':
docker:
- image: satantime/puppeteer-node:14.15.5-buster
steps:
- checkout
- attach_workspace:
at: dist
- restore_cache:
key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }}
- run:
name: Spreading Build
command: npm run s:a12
- run:
name: Spreading Tests
command: npm run s:test:a12
- run:
name: Unit Tests
command: npm run test:a12es2015ivy
'Angular Min ES5':
docker:
- image: satantime/puppeteer-node:14.15.5-buster
Expand Down Expand Up @@ -703,6 +784,18 @@ workflows:
- 'Angular 11 ES2015 Ivy':
requires:
- Install
- 'Angular 12 ES5':
requires:
- Install
- 'Angular 12 ES2015':
requires:
- Install
- 'Angular 12 ES5 Ivy':
requires:
- Install
- 'Angular 12 ES2015 Ivy':
requires:
- Install
- 'Angular Min ES5':
requires:
- Install
Expand Down
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/e2e/a9/node_modules
/e2e/a10/node_modules
/e2e/a11/node_modules
/e2e/a12/node_modules
/e2e/am/node_modules
/node_modules
/test-reports
/tmp
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ docs/**/*.md
docs/.docusaurus
e2e/a10/src/test
e2e/a11/src/test
e2e/a12/src/test
e2e/a5es2015/src/test
e2e/a5es5/src/test
e2e/a6/src/test
e2e/a7/src/test
e2e/a8/src/test
e2e/a9/src/test
e2e/am/src/test
node_modules/
test-reports/
tmp/
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,22 @@ jobs:
$HOME/codeclimate upload-coverage
-r 8d19fbe26762a46ed2e12de542b38738418a96d961cfaca0d757e0a7390ced69
-i test-reports/codeclimate.json
- name: 'E2E'
- name: 'E2E Angular 5 6 7 8 9'
script:
- npm run e2e:a
- npm run build
- npm run i:a5 && npm run i:a6 && npm run i:a7 && npm run i:a8 && npm run i:a9
- npm run clear:a5 && npm run clear:a6 && npm run clear:a7 && npm run clear:a8 && npm run clear:a9
- npm run s:a5 && npm run s:a6 && npm run s:a7 && npm run s:a8 && npm run s:a9
- npm run s:test:a5 && npm run s:test:a6 && npm run s:test:a7 && npm run s:test:a8 && npm run s:test:a9
- npm run test:a5 && npm run test:a6 && npm run test:a7 && npm run test:a8 && npm run test:a9
- name: 'E2E Angular 10 11 12'
script:
- npm run build
- npm run i:a10 && npm run i:a11 && npm run i:a12
- npm run clear:a10 && npm run clear:a11 && npm run clear:a12
- npm run s:a10 && npm run s:a11 && npm run s:a12
- npm run s:test:a10 && npm run s:test:a11 && npm run s:test:a12
- npm run test:a10 && npm run test:a11 && npm run test:a12
before_cache:
- echo '' > $HOME/.npm/anonymous-cli-metrics.json
- mkdir -p $HOME/.npm/_cacache/index-v5/34/8e
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ VOLUME /app/e2e/a8/node_modules
VOLUME /app/e2e/a9/node_modules
VOLUME /app/e2e/a10/node_modules
VOLUME /app/e2e/a11/node_modules
VOLUME /app/e2e/a12/node_modules
VOLUME /app/e2e/am/node_modules

RUN npm config set cache /npm --global

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

The current version of the library **has been tested** and **can be used** with:

- Angular 12 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 11 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 10 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 9 (Jasmine, Jest, Ivy, es5, es2015)
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ services:
- /app/e2e/a9/node_modules
- /app/e2e/a10/node_modules
- /app/e2e/a11/node_modules
- /app/e2e/a12/node_modules
- /app/e2e/am/node_modules
1 change: 1 addition & 0 deletions docs/articles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ keeping interfaces as they are, but suppressing their implementation.

The current version of `ng-mocks` has been tested and **can be used** with:

- Angular 12 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 11 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 10 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 9 (Jasmine, Jest, Ivy, es5, es2015)
Expand Down
17 changes: 17 additions & 0 deletions e2e/a12/.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 versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
2 changes: 2 additions & 0 deletions e2e/a12/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/src/test
59 changes: 59 additions & 0 deletions e2e/a12/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"a12": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/a12",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.json",
"aot": true
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "a12:build"
},
"configurations": {
"production": {
"browserTarget": "a12:build:production"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.json",
"karmaConfig": "karma.conf.js"
}
}
}
}
},
"defaultProject": "a12"
}
11 changes: 11 additions & 0 deletions e2e/a12/jest.es2015ivy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/src/setupJest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.es2015ivy.spec.json',
},
},
};
11 changes: 11 additions & 0 deletions e2e/a12/jest.es2015noivy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/src/setupJest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.es2015noivy.spec.json',
},
},
};
11 changes: 11 additions & 0 deletions e2e/a12/jest.es5ivy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/src/setupJest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.es5ivy.spec.json',
},
},
};
11 changes: 11 additions & 0 deletions e2e/a12/jest.es5noivy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/src/setupJest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.es5noivy.spec.json',
},
},
};
36 changes: 36 additions & 0 deletions e2e/a12/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
jasmine: {
random: false,
},
},
customLaunchers: {
ChromeCi: {
base: 'ChromeHeadless',
flags: ['--headless', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage'],
},
},
reporters: ['kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeCi'],
singleRun: true,
});
};
Loading

0 comments on commit 4627fe2

Please sign in to comment.