Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shutdown() to exit on success. #25

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [14.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# bedrock-test ChangeLog

## 9.0.0 - 2024-xx-xx

### Changed
- Update dependencies:
- `@bedrock/core@6.3.0
- `chai@4.5.0`
- `chai-as-promised@8.0.0`
- `mocha@10.8.2`
- development dependencies.
- **BREAKING**: Use `bedrock.shutdown()` for an orderly exit on success.
- The previous behavior was to abruptly shut down an app, even after testing
success. Now event handlers will be called while app is shutting down:
- `bedrock.stop`
- `bedrock.stopped`
- `bedrock.exit`
- Only support Node.js >=18.

## 8.2.0 - 2024-02-29

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bedrock.events.on('bedrock.started', async () => {
} else {
console.log('All tests passed.');
logger.info('all tests passed.');
bedrock.exit();
await bedrock.shutdown();
}
} catch(err) {
console.log('Tests exited with error', err);
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"main": "./lib/index.js",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"lib/**/*.js"
Expand All @@ -31,21 +31,20 @@
},
"homepage": "https://github.com/digitalbazaar/bedrock-test",
"dependencies": {
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai": "^4.5.0",
"chai-as-promised": "^8.0.0",
"cycle": "^1.0.3",
"mocha": "^10.0.0"
"mocha": "^10.8.2"
},
"peerDependencies": {
"@bedrock/core": "^6.0.0"
"@bedrock/core": "^6.3.0"
},
"directories": {
"lib": "./lib"
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-digitalbazaar": "^2.8.0",
"eslint-plugin-jsdoc": "^37.9.7",
"jsdoc-to-markdown": "^7.1.1"
"eslint": "^8.57.1",
"eslint-config-digitalbazaar": "^5.2.0",
"eslint-plugin-jsdoc": "^50.5.0"
}
}