Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
chore: start echo server before tests
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Sep 7, 2019
1 parent 3a56e72 commit 29a541b
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
const IPFSFactory = require('ipfsd-ctl')
const parallel = require('async/parallel')
const MockPreloadNode = require('./test/utils/mock-preload-node')
const EchoServer = require('interface-ipfs-core/src/utils/echo-http-server')

const ipfsdServer = IPFSFactory.createServer()
const preloadNode = MockPreloadNode.createNode()
const echoServer = EchoServer.createServer()

module.exports = {
bundlesize: { maxSize: '689kB' },
Expand All @@ -26,8 +28,18 @@ module.exports = {
},
hooks: {
node: {
pre: (cb) => preloadNode.start(cb),
post: (cb) => preloadNode.stop(cb)
pre: (cb) => {
parallel([
(cb) => preloadNode.start(cb),
(cb) => echoServer.start(cb)
], cb)
},
post: (cb) => {
parallel([
(cb) => preloadNode.stop(cb),
(cb) => echoServer.stop(cb)
], cb)
}
},
browser: {
pre: (cb) => {
Expand All @@ -36,7 +48,8 @@ module.exports = {
ipfsdServer.start()
cb()
},
(cb) => preloadNode.start(cb)
(cb) => preloadNode.start(cb),
(cb) => echoServer.start(cb)
], cb)
},
post: (cb) => {
Expand All @@ -45,7 +58,8 @@ module.exports = {
ipfsdServer.stop()
cb()
},
(cb) => preloadNode.stop(cb)
(cb) => preloadNode.stop(cb),
(cb) => echoServer.stop(cb)
], cb)
}
}
Expand Down

0 comments on commit 29a541b

Please sign in to comment.