Skip to content

Commit ecb54e4

Browse files
authored
Test with different eslint & angular versions in CI (#4)
* Run CI tests with all supported versions of ESLint (version 7 and 8) and Angular ESLint (version 13 & 14). * This includes the corresponding version of Typescript ESLint. * Updated packages. * Upgraded Jest.
1 parent b7adfc7 commit ecb54e4

File tree

10 files changed

+1906
-2516
lines changed

10 files changed

+1906
-2516
lines changed

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// List of words to be always considered correct.
88
"words": [
99
"autobuild",
10+
"classname",
1011
"cobertura",
1112
"codecov",
1213
"CODELYZER",

.github/workflows/ci.yml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,50 @@ jobs:
1818

1919
test:
2020
runs-on: ubuntu-latest
21-
name: "test (node v${{ matrix.node-version }})"
21+
name: "test (Node.js ${{ matrix.node-version }}, ESLint ${{ matrix.eslint-version }}, Angular ESLint ${{ matrix.angular-eslint-version[0] }})"
2222
strategy:
23+
fail-fast: false # Run all jobs, even when previous fails.
2324
matrix:
24-
node-version: [
25-
# Angular supported Node.js versions.
26-
# https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
27-
14.15.0,
28-
16.10.0,
29-
# Run on Angular supported versions and latest Node.js version,
30-
# and assume that the intermediate versions are good.
31-
18,
32-
]
25+
# Run on latest and Angular supported Node.js versions,
26+
# and assume that the intermediate versions are good.
27+
node-version:
28+
# Angular supported Node.js versions.
29+
# https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
30+
- 14.15.0
31+
- 16.10.0
32+
# Latest Node.js version.
33+
- latest
34+
eslint-version: [7, 8]
35+
# Angular ESLint version, and corresponding Typescript ESLint version.
36+
angular-eslint-version:
37+
- [13, "5.27.1"]
38+
- [14, "latest"]
3339
steps:
3440
- uses: actions/checkout@v3
3541
- name: Setup Node.js ${{ matrix.node-version }}
3642
uses: actions/setup-node@v3
3743
with:
3844
node-version: ${{ matrix.node-version }}
3945
cache: "npm"
40-
- run: npm ci --no-fund
41-
- run: npm run test
46+
- name: Install packages
47+
run: npm ci --no-fund
48+
- name: Install Angular ESLint ${{ matrix.angular-eslint-version[0] }}
49+
run: |
50+
npm install --save-dev \
51+
@angular-eslint/template-parser@${{ matrix.angular-eslint-version[0] }} \
52+
@angular-eslint/utils@${{ matrix.angular-eslint-version[0] }} \
53+
@angular/compiler@${{ matrix.angular-eslint-version[0] }} \
54+
@typescript-eslint/eslint-plugin@${{ matrix.angular-eslint-version[1] }} \
55+
@typescript-eslint/parser@${{ matrix.angular-eslint-version[1] }}
56+
- name: Install ESLint ${{ matrix.eslint-version }}
57+
run: npm install --save-dev eslint@${{ matrix.eslint-version }}
58+
- name: Run tests
59+
run: npm run test
4260
- name: Test Report
4361
uses: dorny/test-reporter@v1
4462
if: success() || failure() # Run this step even if previous step failed.
4563
with:
46-
name: "test report (node v${{ matrix.node-version }})"
64+
name: "test report (Node.js ${{ matrix.node-version }}, ESLint ${{ matrix.eslint-version }}, Angular ESLint ${{ matrix.angular-eslint-version[0] }})"
4765
path: coverage/junit.xml
4866
reporter: jest-junit
4967

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Read more about this rule [in the documentation](https://github.com/jerone/eslin
2929

3030
You'll need to have an Angular project with the following packages installed:
3131

32-
- [ESLint](https://eslint.org/)
33-
- [Angular ESLint](https://github.com/angular-eslint/angular-eslint)
32+
- [ESLint](https://eslint.org/) - version 7 and 8 are tested.
33+
- [Angular ESLint](https://github.com/angular-eslint/angular-eslint) - version 13 and 14 are tested.
3434

3535
## Installation
3636

jest.config.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
22
module.exports = {
33
preset: "ts-jest",
44
collectCoverage: true,
@@ -25,9 +25,5 @@ module.exports = {
2525
},
2626
],
2727
],
28-
globals: {
29-
"ts-jest": {
30-
tsconfig: "tsconfig.test.json",
31-
},
32-
},
28+
testEnvironment: "node",
3329
};

0 commit comments

Comments
 (0)