mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-16 23:50:51 +00:00
* chore: auto relay example * chore: update examples to use process arguments * chore: add test setup for node tests and test for auto-relay * chore: apply suggestions from code review * chore: do not use promise for multiaddrs event on example
34 lines
588 B
JavaScript
34 lines
588 B
JavaScript
'use strict'
|
|
|
|
process.on('unhandedRejection', (err) => {
|
|
console.error(err)
|
|
|
|
process.exit(1)
|
|
})
|
|
|
|
const path = require('path')
|
|
const fs = require('fs')
|
|
const {
|
|
waitForOutput
|
|
} = require('./utils')
|
|
|
|
async function testAll () {
|
|
for (const dir of fs.readdirSync(__dirname)) {
|
|
if (dir === 'node_modules' || dir === 'tests_output') {
|
|
continue
|
|
}
|
|
|
|
const stats = fs.statSync(path.join(__dirname, dir))
|
|
|
|
if (!stats.isDirectory()) {
|
|
continue
|
|
}
|
|
|
|
await waitForOutput('npm info ok', 'npm', ['test', '--', dir], {
|
|
cwd: __dirname
|
|
})
|
|
}
|
|
}
|
|
|
|
testAll()
|