Skip to content

Commit 9c87af8

Browse files
committed
Update ESLint configuration to include Jest environment for test files and modify CI workflow to use Node.js 20.x, simplifying the setup by removing matrix builds. Adjust test assertions for better accuracy in duration checks.
1 parent dac4ee6 commit 9c87af8

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ module.exports = {
1212
es6: true,
1313
},
1414
ignorePatterns: ["dist/", "node_modules/", "coverage/", "*.js", "*.d.ts"],
15+
overrides: [
16+
{
17+
files: ["**/*.test.ts", "**/*.spec.ts"],
18+
env: {
19+
jest: true,
20+
},
21+
},
22+
],
1523
rules: {
1624
// General ESLint rules
1725
"no-console": "warn",

.github/workflows/ci.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,18 @@ jobs:
3737
run: npx tsc --noEmit
3838

3939
test:
40-
name: Tests (Node ${{ matrix.node-version }})
40+
name: Tests (Node 20.x)
4141
runs-on: ubuntu-latest
4242
needs: code-quality
4343

44-
strategy:
45-
fail-fast: false
46-
matrix:
47-
node-version: [18.x, 20.x, 22.x]
48-
4944
steps:
5045
- name: Checkout repository
5146
uses: actions/checkout@v4
5247

53-
- name: Setup Node.js ${{ matrix.node-version }}
48+
- name: Setup Node.js 20.x
5449
uses: actions/setup-node@v4
5550
with:
56-
node-version: ${{ matrix.node-version }}
51+
node-version: 20.x
5752
cache: "npm"
5853

5954
- name: Install dependencies
@@ -63,11 +58,9 @@ jobs:
6358
run: npm test
6459

6560
- name: Generate coverage report
66-
if: matrix.node-version == '20.x'
6761
run: npm run test:coverage
6862

6963
- name: Upload coverage to Codecov
70-
if: matrix.node-version == '20.x'
7164
uses: codecov/codecov-action@v3
7265
with:
7366
file: ./coverage/lcov.info
@@ -76,7 +69,6 @@ jobs:
7669
fail_ci_if_error: false
7770

7871
- name: Archive coverage artifacts
79-
if: matrix.node-version == '20.x'
8072
uses: actions/upload-artifact@v4
8173
with:
8274
name: coverage-report

tests/utils/batch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('BatchProcessor', () => {
1818
expect(result.failed).toHaveLength(0);
1919
expect(result.batchNumber).toBe(2); // 6 items / 3 batch size = 2 batches
2020
expect(operation).toHaveBeenCalledTimes(6);
21-
expect(result.duration).toBeGreaterThan(0);
21+
expect(result.duration).toBeGreaterThanOrEqual(0); // Duration can be 0 for fast operations
2222
});
2323

2424
it('should handle partial failures', async () => {

0 commit comments

Comments
 (0)