Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return () => {
const VERSION_STRING = type === 'js'
? `js-ipfs version: ${require('ipfs/package.json').version}`
: 'ipfs version 0.4.13'
describe('daemon spawning', () => {
it('prints the version', function (done) {
if (!isNode || type === 'proc') {
this.skip()
}
df.version({ exec }, (err, version) => {
expect(err).to.not.exist()
expect(version).to.be.eql(VERSION_STRING)
done()
})
})
describe('spawn a bare node', function () {
this.ipfsd = null
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { isNode } = require('ipfs-utils/src/env')
const hat = require('hat')
const IPFSFactory = require('../src')
const JSIPFS = require('ipfs')
const { repoExists } = require('./../src/utils/repo/nodejs')
const tests = [
{ type: 'go', bits: 1024 },
{ type: 'js', bits: 512 },
{ type: 'proc', exec: JSIPFS, bits: 512 }
]
const jsVersion = require('ipfs/package.json').version
const versions = {
js: `js-ipfs version: ${jsVersion}`,
go: `ipfs version ${require('go-ipfs-dep/package.json').version}`,
proc: jsVersion
}
describe('Spawn options', function () {
this.timeout(60 * 1000)
tests.forEach((fOpts) => describe(`${fOpts.type}`, () => {
const VERSION_STRING = versions[fOpts.type]
let f
before(() => {
f = IPFSFactory.create(fOpts)
})