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

Commit cfaf4bb

Browse files
committed
Check expected http returned values.
1 parent f1f5884 commit cfaf4bb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/http-api/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ exports = module.exports = function HttpApi (repo) {
1919

2020
this.start = (callback) => {
2121
if (typeof repo === 'string') {
22-
console.log('here')
2322
repo = new IPFSRepo(repo, {stores: fsbs})
2423
}
2524

test/http-api-tests/test-files.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ module.exports = (httpAPI) => {
5656
payload: payload
5757
}, (res) => {
5858
expect(res.statusCode).to.equal(200)
59+
var result = JSON.parse(res.result)
60+
expect(result.Name).to.equal('node.json')
61+
expect(result.Hash).to.equal('QmRRdjTN2PjyEPrW73GBxJNAZrstH5tCZzwHYFJpSTKkhe')
5962
done()
6063
})
6164
})
@@ -77,6 +80,11 @@ module.exports = (httpAPI) => {
7780
payload: payload
7881
}, (res) => {
7982
expect(res.statusCode).to.equal(200)
83+
var results = res.result.split('\n').slice(0, -1).map(JSON.parse)
84+
expect(results[0].Name).to.equal('hello')
85+
expect(results[0].Hash).to.equal('QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o')
86+
expect(results[1].Name).to.equal('otherconfig')
87+
expect(results[1].Hash).to.equal('QmayedZNznnEbHtyfjeQvvt29opSLjYjLtLqwfwSWq28ds')
8088
done()
8189
})
8290
})

0 commit comments

Comments
 (0)