Skip to content

Commit ec0091f

Browse files
Migrate to npm, add new jest GH Action test annotations (#81)
- Removed outdated Yarn v1 and replaced it with npm - Updated Jest to the latest version - Added a new Jest github-actions reporter to produce per-line annotations for failed tests in the PR "Files changed" section - Cleaned up config.json and reorganized its structure to improve readability
1 parent cf873d5 commit ec0091f

15 files changed

Lines changed: 7450 additions & 3700 deletions

.github/workflows/pull_request.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
uses: actions/setup-node@v4
1313
with:
1414
node-version: "22"
15-
- name: Install package
16-
run: yarn install --frozen-lockfile
17-
- name: Run the linter
18-
run: yarn lint
15+
- name: Install Dependencies
16+
run: npm ci
17+
- name: Run Linter
18+
run: npm run lint
1919

20-
unit-tests:
20+
tests:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
@@ -26,18 +26,18 @@ jobs:
2626
uses: actions/setup-node@v4
2727
with:
2828
node-version: "22"
29-
- name: Install package
30-
run: yarn install --frozen-lockfile
31-
- name: Run Tests
32-
run: yarn test --ci --reporters=default --reporters=jest-junit
29+
- name: Install Dependencies
30+
run: npm ci
31+
- name: Run Tests and Add Annotations
32+
run: npm test -- --ci --reporters=default --reporters=github-actions --reporters=jest-junit
3333
env:
3434
CONDUCTOR_SERVER_URL: ${{ vars.SERVER_URL }}
3535
CONDUCTOR_AUTH_KEY: ${{ secrets.AUTH_KEY }}
3636
CONDUCTOR_AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
37-
- name: Publish Test Results
38-
if: always()
37+
- name: Publish Dorny Test Results Summary
3938
uses: dorny/test-reporter@v2
39+
if: ${{ !cancelled() }}
4040
with:
4141
name: Test report
42-
path: reports/jest-*.xml
42+
path: reports/jest-junit.xml
4343
reporter: jest-junit

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
env:
2121
RELEASE_VERSION: ${{ github.ref_name }}
2222
- name: Install dependencies required to build package
23-
run: yarn install --frozen-lockfile
23+
run: npm ci
2424
- name: Build package
25-
run: yarn build
25+
run: npm run build
2626
- name: Publish package
2727
run: npm publish --access public
2828
env:

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import eslint from '@eslint/js';
22
import tseslint from 'typescript-eslint';
3+
import { defineConfig } from "eslint/config";
34

4-
export default tseslint.config(
5+
export default defineConfig(
56
eslint.configs.recommended,
67
tseslint.configs.recommended, // to remove
78
//tseslint.configs.strict, // to add

jest.config.mjs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
import 'dotenv/config';
2-
3-
/*
4-
* For a detailed explanation regarding each configuration property, visit:
5-
* https://jestjs.io/docs/configuration
6-
*/
1+
import "dotenv/config";
72

83
export default {
9-
preset: 'ts-jest',
4+
preset: "ts-jest",
105
clearMocks: true,
116
coverageProvider: "v8",
127
testMatch: [
138
"**/__tests__/**/*.test.[jt]s?(x)",
14-
"**/?(*.)+(spec|test).[tj]s?(x)"
9+
"**/?(*.)+(spec|test).[tj]s?(x)",
1510
],
16-
transformIgnorePatterns: [
17-
"/node_modules/",
18-
"\\.pnp\\.[^\\/]+$"
19-
]
20-
};
11+
transformIgnorePatterns: ["/node_modules/", "\\.pnp\\.[^\\/]+$"],
12+
};

0 commit comments

Comments
 (0)