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

Commit 108414b

Browse files
committed
refactor(module+tests): Enable running the tests
individually and reduce complexity inside ipfs-api
1 parent 73078ea commit 108414b

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"http://exam
105105

106106
### API
107107

108-
> `WIP`
109-
110-
`js-ipfs-api` follows the spec defined by [`interface-ipfs-core`](https://github.com/ipfs/interface-ipfs-core), which concerns the interface to expect from IPFS implementations. This interface is a currently active endeavor - expect it to be complete in the next few weeks (August 2016). You can use it today to consult the methods available.
108+
> `js-ipfs-api` follows the spec defined by [`interface-ipfs-core`](https://github.com/ipfs/interface-ipfs-core), which concerns the interface to expect from IPFS implementations. This interface is a currently active endeavor - expect it to be complete in the next few weeks (August 2016). You can use it today to consult the methods available.
111109
112110
### Utility functions
113111

@@ -140,6 +138,7 @@ This is very similar to `ipfs.files.add({path:'', content: stream})`. It is like
140138

141139
```JavaScript
142140
```
141+
>>>>>> refactor(module+tests): Enable running the tests
143142
144143
### Callbacks and promises
145144

@@ -166,8 +165,6 @@ We run tests by executing `npm test` in a terminal window. This will run both No
166165

167166

168167

169-
>>>>>>> kick off ipfs-api next generation
170-
171168
## Contribute
172169

173170
The js-ipfs-api is a work in progress. As such, there's a few things you can do right now to help out:

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "ipfs-api",
33
"version": "6.0.3",
4-
"description": "A client library for the IPFS API",
5-
"main": "src/index.js",
4+
"description": "A client library for the IPFS HTTP API. Follows interface-ipfs-core spec",
5+
"main": "lib/index.js",
66
"jsnext:main": "src/index.js",
77
"scripts": {
88
"test": "gulp test",

test/interface-ipfs-core/config.spec.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/* eslint-env mocha */
22
/* eslint max-nested-callbacks: ["error", 8] */
3-
/* globals apiClients */
43
'use strict'
54

65
const test = require('interface-ipfs-core')
6+
const FactoryClient = require('../factory/factory-client')
7+
8+
let fc
79

810
const common = {
9-
setup: function (cb) {
10-
cb(null, apiClients.a)
11+
setup: function (callback) {
12+
fc = new FactoryClient()
13+
callback(null, fc)
1114
},
12-
teardown: function (cb) {
13-
cb()
15+
teardown: function (callback) {
16+
fc.dismantle(callback)
1417
}
1518
}
1619

test/tmp-disposable-nodes-addrs.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"c":"/ip4/127.0.0.1/tcp/56459","a":"/ip4/127.0.0.1/tcp/56466","b":"/ip4/127.0.0.1/tcp/56479"}

0 commit comments

Comments
 (0)