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

testing(): add object.get tests for multihash string #139

Merged
merged 3 commits into from
May 11, 2017

Conversation

kenshyx
Copy link
Contributor

@kenshyx kenshyx commented May 10, 2017

These tests will pass after ipfs/js-ipfs#849 is merged

Copy link
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kenshyx ! Just a couple of comments and we should be golden. Notice that it is failing on linting.

ipfs.object.put(testObj).then((node1) => {
ipfs.object.get(node1.multihash).then((node2) => {
return ipfs.object.put(testObj).then((node1) => {
return ipfs.object.get(node1.multihash).then((node2) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenshyx all of these tests are written to test the callback API. Check at the bottom the section to test de promises API.

We always test in depth through the Callback API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, those lines are under promise API :)

src/object.js Outdated
// get object from ipfs multihash string
return ipfs.object.get(node1.toJSON().multihash).then((node2) => {
expect(node2).to.exist()
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a separate test.

@daviddias
Copy link
Contributor

Oh, I just realized I didn't read correctly where the changes were being added and in fact, you were doing the right thing! It seems that all of the other Promise API tests are finishing through calling done instead of returning a promise, which is bad because errors are not caught.

I'm sorry for the confusion @kenshyx, would you like to fix all the Promise API tests? If not I can do it as my redemption :)

@kenshyx
Copy link
Contributor Author

kenshyx commented May 11, 2017

Yes, I'll do it.

@kenshyx
Copy link
Contributor Author

kenshyx commented May 11, 2017

Let me know if there is something else I have to update @diasdavid

@daviddias daviddias merged commit 5da5966 into ipfs-inactive:master May 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants