-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- update aegir - fix some linting - enable multiple test runs at the same time (all servers now try to find free ports) Co-authored-by: achingbrain <[email protected]>
- Loading branch information
1 parent
bf59df6
commit b9db560
Showing
4 changed files
with
36 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
'use strict' | ||
|
||
const { createServer } = require('ipfsd-ctl') | ||
const getPort = require('aegir/utils/get-port') | ||
|
||
const server = createServer({ | ||
host: '127.0.0.1', | ||
port: 48372 | ||
}, { | ||
type: 'go', | ||
ipfsHttpModule: require('./'), | ||
ipfsBin: require('go-ipfs').path() | ||
}) | ||
|
||
/** @type {import('aegir').PartialOptions} */ | ||
module.exports = { | ||
bundlesize: { maxSize: '83kB' }, | ||
hooks: { | ||
browser: { | ||
pre: async () => { | ||
await server.start() | ||
}, | ||
post: async () => { | ||
await server.stop() | ||
build: { | ||
bundlesizeMax: '110kB' | ||
}, | ||
test: { | ||
async before (options) { | ||
const port = await getPort() | ||
const server = createServer({ | ||
host: '127.0.0.1', | ||
port: port | ||
}, { | ||
type: 'go', | ||
ipfsHttpModule: require('./'), | ||
ipfsBin: require('go-ipfs').path() | ||
}) | ||
|
||
await server.start() | ||
return { | ||
server, | ||
env: { | ||
IPFSD_SERVER: `http://${server.host}:${server.port}` | ||
} | ||
} | ||
}, | ||
async after (options, before) { | ||
await before.server.stop() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters