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

Test on bare #678

Merged
merged 5 commits into from
Apr 3, 2025
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/test-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- run: npm -g install bare
- run: npm run test:bare
trigger_canary:
if: startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed)
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"test": "standard && node test/all.js",
"test:bare": "bare test/all.js",
"test:generate": "brittle -r test/all.js test/*.js"
},
"repository": {
Expand Down Expand Up @@ -73,6 +74,7 @@
"standard": "^17.0.0",
"test-tmp": "^1.0.2",
"tiny-byte-size": "^1.1.0",
"udx-native": "^1.6.1"
"udx-native": "^1.6.1",
"uncaughts": "^1.1.0"
}
}
7 changes: 4 additions & 3 deletions test/sessions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const uncaughts = require('uncaughts')
const test = require('brittle')
const crypto = require('hypercore-crypto')
const c = require('compact-encoding')
Expand Down Expand Up @@ -122,6 +123,8 @@ test('sessions - checkout breaks prologue', async function (t) {
const storage = await createStorage(t)
const storage2 = await createStorage(t)

uncaughts.on(noop)

const core = new Hypercore(storage)

for (let i = 0; i < 10; i++) await core.append(b4a.from([i]))
Expand All @@ -139,8 +142,6 @@ test('sessions - checkout breaks prologue', async function (t) {
await prologued.ready()
await prologued.core.copyPrologue(core.state)

process.on('uncaughtException', noop)

let session
try {
session = prologued.session({ name: 'fail', checkout: 7 })
Expand All @@ -154,7 +155,7 @@ test('sessions - checkout breaks prologue', async function (t) {
await prologued.close()
await core.close()

process.off('uncaughtException', noop)
uncaughts.off(noop)
})

function noop () {}