diff --git a/test/gateway/index.js b/test/gateway/index.js index c5f9bd0be6..8ad692288d 100644 --- a/test/gateway/index.js +++ b/test/gateway/index.js @@ -5,7 +5,7 @@ const chai = require('chai') const dirtyChai = require('dirty-chai') const expect = chai.expect chai.use(dirtyChai) -const API = require('../../src/http') +const StandaloneDaemon = require('../../src/cli/standalone-daemon') const loadFixture = require('aegir/fixtures') const os = require('os') const path = require('path') @@ -33,7 +33,7 @@ describe('HTTP Gateway', function () { this.timeout(60 * 1000) const repoPath = path.join(os.tmpdir(), '/ipfs-' + hat()) - http.api = new API({ + http.api = new StandaloneDaemon({ repo: repoPath, init: true, config: { @@ -60,7 +60,7 @@ describe('HTTP Gateway', function () { await http.api.start() - gateway = http.api._gatewayServers[0] + gateway = http.api._httpApi._gatewayServers[0] // QmbQD7EMEL1zeebwBsWEfA3ndgSS6F7S6iTuwuqasPgVRi await http.api._ipfs.add([ diff --git a/test/http-api/inject/bitswap.js b/test/http-api/inject/bitswap.js index 9ac273c947..303831884b 100644 --- a/test/http-api/inject/bitswap.js +++ b/test/http-api/inject/bitswap.js @@ -12,7 +12,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) before(async function () { diff --git a/test/http-api/inject/block.js b/test/http-api/inject/block.js index a121fc315d..e247dc9225 100644 --- a/test/http-api/inject/block.js +++ b/test/http-api/inject/block.js @@ -13,7 +13,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('/block/put', () => { diff --git a/test/http-api/inject/bootstrap.js b/test/http-api/inject/bootstrap.js index 5015b3d40f..5c791f2861 100644 --- a/test/http-api/inject/bootstrap.js +++ b/test/http-api/inject/bootstrap.js @@ -11,7 +11,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] return api.inject({ method: 'GET', url: '/api/v0/bootstrap/add/default' diff --git a/test/http-api/inject/config.js b/test/http-api/inject/config.js index 2388ed4264..f361037569 100644 --- a/test/http-api/inject/config.js +++ b/test/http-api/inject/config.js @@ -17,7 +17,7 @@ module.exports = (http) => { before(() => { updatedConfig = () => JSON.parse(fs.readFileSync(configPath, 'utf8')) - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) after(() => { diff --git a/test/http-api/inject/dag.js b/test/http-api/inject/dag.js index 62eca02574..605cb076dd 100644 --- a/test/http-api/inject/dag.js +++ b/test/http-api/inject/dag.js @@ -33,7 +33,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('/dag/get', () => { diff --git a/test/http-api/inject/dht.js b/test/http-api/inject/dht.js index 04cb501227..455a4bb8b1 100644 --- a/test/http-api/inject/dht.js +++ b/test/http-api/inject/dht.js @@ -12,7 +12,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('/findpeer', () => { diff --git a/test/http-api/inject/dns.js b/test/http-api/inject/dns.js index 010797f57a..18f0ec5925 100644 --- a/test/http-api/inject/dns.js +++ b/test/http-api/inject/dns.js @@ -8,7 +8,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) it('resolve ipfs.io dns', async () => { diff --git a/test/http-api/inject/files.js b/test/http-api/inject/files.js index 8ff819dfce..aaf4f10dd5 100644 --- a/test/http-api/inject/files.js +++ b/test/http-api/inject/files.js @@ -13,7 +13,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('/add', () => { diff --git a/test/http-api/inject/id.js b/test/http-api/inject/id.js index ff8922f312..f3f7160375 100644 --- a/test/http-api/inject/id.js +++ b/test/http-api/inject/id.js @@ -8,7 +8,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) it('get the id', async () => { diff --git a/test/http-api/inject/name.js b/test/http-api/inject/name.js index 699ed0a07b..1e723c3749 100644 --- a/test/http-api/inject/name.js +++ b/test/http-api/inject/name.js @@ -16,7 +16,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) it('should publish a record', async function () { diff --git a/test/http-api/inject/object.js b/test/http-api/inject/object.js index 952cf1ab7d..662474e0b0 100644 --- a/test/http-api/inject/object.js +++ b/test/http-api/inject/object.js @@ -17,7 +17,7 @@ module.exports = (http) => { let api before('api', () => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('/new', () => { diff --git a/test/http-api/inject/pin.js b/test/http-api/inject/pin.js index db1ec00b6c..ceb11ae400 100644 --- a/test/http-api/inject/pin.js +++ b/test/http-api/inject/pin.js @@ -37,7 +37,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('rm', () => { diff --git a/test/http-api/inject/ping.js b/test/http-api/inject/ping.js index 3ed712c483..ef8cd3bee4 100644 --- a/test/http-api/inject/ping.js +++ b/test/http-api/inject/ping.js @@ -13,7 +13,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) it('returns 400 if both n and count are provided', async () => { diff --git a/test/http-api/inject/pubsub.js b/test/http-api/inject/pubsub.js index 3e88d40434..86cec4f078 100644 --- a/test/http-api/inject/pubsub.js +++ b/test/http-api/inject/pubsub.js @@ -16,7 +16,7 @@ module.exports = (http) => { const topicNotSubscribed = 'somethingRandom' before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) describe('/sub', () => { diff --git a/test/http-api/inject/resolve.js b/test/http-api/inject/resolve.js index 1d70206e8a..21baf6ba71 100644 --- a/test/http-api/inject/resolve.js +++ b/test/http-api/inject/resolve.js @@ -12,7 +12,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) it('should resolve a path and return a base2 encoded CID', async () => { diff --git a/test/http-api/inject/version.js b/test/http-api/inject/version.js index 9a83821ebe..d1cb6a1577 100644 --- a/test/http-api/inject/version.js +++ b/test/http-api/inject/version.js @@ -9,7 +9,7 @@ module.exports = (http) => { let api before(() => { - api = http.api._apiServers[0] + api = http.api._httpApi._apiServers[0] }) it('get the version', async () => { diff --git a/test/http-api/routes.js b/test/http-api/routes.js index 0fa6fdf7df..ed971d2928 100644 --- a/test/http-api/routes.js +++ b/test/http-api/routes.js @@ -6,7 +6,7 @@ const chai = require('chai') const dirtyChai = require('dirty-chai') chai.use(dirtyChai) const hat = require('hat') -const API = require('../../src/http/index') +const StandaloneDaemon = require('../../src/cli/standalone-daemon') const promisify = require('promisify-es6') const ncp = promisify(require('ncp').ncp) const path = require('path') @@ -22,7 +22,7 @@ describe('HTTP API', () => { let http = {} const startHttpAPI = async (config) => { - http.api = new API({ + http.api = new StandaloneDaemon({ repo: repoTests, pass: hat(), config,