-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Describe the issue
We see a test file which when run in isolation works, but fails when run with a glob script like
"test:js": "cross-env NODE_ENV=test tape -r esm 'test/**/*.test.js' | tap-arc",
The error looks like:
test count(1) != plan(null)
The test looks like :
const test = require('tape')
const TestBot = require('./test-bot')
function setENV (env) {
process.env.NODE_ENV = env
// console.info('set NODE_ENV=', env)
}
// this test passes in isolation, but fails in the suite... why?
// this only happens with tap-arc T_T
// tap-spec works fine
test('init (run migrations)', t => {
t.plan(1)
const initialENV = process.env.NODE_ENV
setENV('production')
TestBot()
.then(({ ssb }) => {
setENV(initialENV)
t.pass('ran migrations, started up')
ssb.close()
})
.catch(err => t.error(err, 'init (run migrations) threw an error')) // should not be run
})
Inside TestBot there is some async stuff running database migrations, a setImmediate
What's strange is tap-spec
doesn't hit this bug, and tape without a pretty-printer is fine.
REPO: https://gitlab.com/ahau/lib/ssb-plugins/ssb-ahau
file : tests/init.test.js
Metadata
Metadata
Assignees
Labels
No labels