Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 9b8fed0

Browse files
committed
test: verify that add errors with valid paths, users should use addFromFs instead
1 parent 99677f8 commit 9b8fed0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/add.spec.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* eslint-env mocha */
2+
/* eslint max-nested-callbacks: ["error", 8] */
3+
'use strict'
4+
5+
const expect = require('chai').expect
6+
const isNode = require('detect-node')
7+
const path = require('path')
8+
9+
const FactoryClient = require('./ipfs-factory/client')
10+
11+
describe('.add (extra tests)', () => {
12+
if (!isNode) { return }
13+
14+
let ipfs
15+
let fc
16+
17+
before(function (done) {
18+
this.timeout(20 * 1000) // slow CI
19+
fc = new FactoryClient()
20+
fc.spawnNode((err, node) => {
21+
expect(err).to.not.exist
22+
ipfs = node
23+
done()
24+
})
25+
})
26+
27+
after((done) => fc.dismantle(done))
28+
29+
it('add file for testing', (done) => {
30+
const validPath = path.join(process.cwd() + '/package.json')
31+
32+
ipfs.files.add(validPath, (err, res) => {
33+
expect(err).to.exist
34+
done()
35+
})
36+
})
37+
})

0 commit comments

Comments
 (0)