Skip to content

Commit 254da40

Browse files
committed
Add separate workflow for Node.js 16 with compatible Jest version
1 parent 1882cac commit 254da40

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

.github/workflows/node16-tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Node.js 16 Tests
2+
3+
on:
4+
schedule:
5+
# Run every hour
6+
- cron: '0 * * * *'
7+
# Also run on push to main branch
8+
push:
9+
branches: [ main ]
10+
# Allow manual triggering
11+
workflow_dispatch:
12+
13+
jobs:
14+
node16-tests:
15+
name: Node.js 16.x Tests
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Node.js 16.x
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: '16.x'
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: |
30+
# Remove incompatible Jest 30.x
31+
yarn remove jest
32+
# Install Jest 29.x which is compatible with Node.js 16
33+
yarn add jest@29 --dev
34+
35+
- name: Run unit tests
36+
run: yarn test:unit
37+
38+
- name: Upload test results
39+
if: always()
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: node16-test-results
43+
path: |
44+
junit.xml
45+
retention-days: 7

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# E2E Tests for console-table-printer and simple-wcswidth
22

33
![Hourly Tests](https://github.com/console-table-printer/e2e/workflows/Hourly%20Tests/badge.svg)
4+
![Node.js 16 Tests](https://github.com/console-table-printer/e2e/workflows/Node.js%2016%20Tests/badge.svg)
45

56
This repository contains end-to-end tests for the [console-table-printer](https://github.com/ayonious/console-table-printer) and [simple-wcswidth](https://github.com/ayonious/simple-wcswidth) packages.
67

@@ -56,7 +57,9 @@ This repository uses GitHub Actions to run tests automatically:
5657

5758
- Tests run hourly to ensure continuous compatibility
5859
- Tests run on every push to the main branch
59-
- Unit tests run on multiple Node.js versions (16.x, 18.x, 20.x, 22.x, 24.x)
60+
- Unit tests run on multiple Node.js versions:
61+
- Node.js 16.x (using Jest 29.x for compatibility)
62+
- Node.js 18.x, 20.x, 22.x, 24.x (using Jest 30.x)
6063
- E2E tests run after unit tests pass
6164
- Manual test runs can be triggered from the Actions tab in GitHub
6265

0 commit comments

Comments
 (0)