Skip to content

Commit 7b86935

Browse files
committed
Improve the integration tests
1 parent 4cc407e commit 7b86935

5 files changed

Lines changed: 1069 additions & 281 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [20.x, 22.x]
16-
mongodb-version: ['4.4', '5.0', '6.0', '7.0']
15+
node-version: [20.x, 21,x, 22.x, 23.x, 24.x, 25.x]
1716

1817
steps:
1918
- uses: actions/checkout@v4
@@ -24,11 +23,6 @@ jobs:
2423
node-version: ${{ matrix.node-version }}
2524
cache: 'npm'
2625

27-
- name: Start MongoDB ${{ matrix.mongodb-version }}
28-
uses: supercharge/mongodb-github-action@1.11.0
29-
with:
30-
mongodb-version: ${{ matrix.mongodb-version }}
31-
3226
- name: Install dependencies
3327
run: npm ci
3428

@@ -38,12 +32,15 @@ jobs:
3832
- name: Run tests with coverage
3933
run: npm test
4034

35+
- name: Run integration tests
36+
run: npm run test:integration
37+
4138
- name: Upload coverage to Coveralls
4239
uses: coverallsapp/github-action@v2
4340
with:
4441
github-token: ${{ secrets.GITHUB_TOKEN }}
4542
parallel: true
46-
flag-name: node-${{ matrix.node-version }}-mongodb-${{ matrix.mongodb-version }}
43+
flag-name: node-${{ matrix.node-version }}
4744

4845
finish:
4946
needs: test

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

7+
## [14.0.4] - 2025-12-03
8+
- Integrate integration tests into main CI workflow
9+
- Run integration tests after unit tests in GitHub Actions
10+
- Remove unnecessary MongoDB version matrix (tests use mongodb-memory-server)
11+
- Rename script from `integration-test` to `test:integration` for consistency
12+
- Expand integration test suite to 56 comprehensive tests
13+
- **ESM Module System** (4 tests): init -m esm, config, migration files, export syntax
14+
- **Custom Configuration** (4 tests): -f flag, --migrations-dir, custom changelog, DB in URL
15+
- **File Hash Feature** (4 tests): useFileHash storage, status display, modification detection
16+
- **Migration Blocks** (4 tests): batch rollback with -b flag, block assignment, selective rollback
17+
- **Sample Migration Override** (2 tests): custom templates, default fallback
18+
- **Client Parameter** (3 tests): client availability in up/down, session support
19+
- **File Extensions** (3 tests): .js files, async/await, promise syntax
20+
- **Status Command** (3 tests): PENDING display, timestamps, chronological sorting
21+
- **CLI Options** (4 tests): -V version, -h help, command help, invalid commands
22+
- **Large-Scale Performance** (3 tests): 20+ files, bulk operations, 1000+ documents
23+
- Total: 56 integration tests across 15 test suites
24+
- Runtime: ~50 seconds, 1,116 lines of code
25+
- Covers all documented features and error scenarios
26+
- Improve integration test suite with better organization and coverage
27+
- Split single 214-line test into 22 focused tests across 5 suites
28+
- Add comprehensive error scenario testing (8 new tests)
29+
- Add multiple migration testing (4 new tests)
30+
- Test edge cases: syntax errors, missing functions, invalid configs
31+
732
## [14.0.3] - 2025-12-03
833
- Add comprehensive integration tests
934
- Test full migration lifecycle (init, create, up, down, status)

INTEGRATION_TEST_README.md

Lines changed: 0 additions & 136 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "jest --coverage",
1111
"test:watch": "jest --watch",
1212
"test:ci": "jest --coverage --ci",
13-
"integration-test": "jest test/integration.test.js --runInBand --detectOpenHandles --testPathIgnorePatterns=/node_modules/",
13+
"test:integration": "jest test/integration.test.js --runInBand --detectOpenHandles --testPathIgnorePatterns=/node_modules/",
1414
"lint": "eslint lib/ test/",
1515
"lint:fix": "eslint lib/ test/ --fix"
1616
},

0 commit comments

Comments
 (0)