-
Notifications
You must be signed in to change notification settings - Fork 124
test(files): add test to ensure meaningful error is thrown in cat()
#330
base: master
Are you sure you want to change the base?
Conversation
… `cat()` A test to verify this is available at ipfs-inactive/interface-js-ipfs-core#330 and needs to be merged first. Fixes #799 License: MIT Signed-off-by: Pascal Precht pascal.precht@gmail.com
… `cat()` A test to verify this is available at ipfs-inactive/interface-js-ipfs-core#330 and needs to be merged first. Fixes #799 License: MIT Signed-off-by: Pascal Precht pascal.precht@gmail.com
To verify changes discussed in https://github.com/ipfs/js-ipfs-api/issues/799#issuecomment-402086401, this commit adds a test that checks `files.cat()` throws a meaningful error when a key or ipfs path with unsupported encoding is given. License: MIT Signed-off-by: Pascal Precht pascal.precht@gmail.com
8580168
to
4585d39
Compare
A test to verify this is available at ipfs-inactive/interface-js-ipfs-core#330 and needs to be merged first. Fixes #799 License: MIT Signed-off-by: Pascal Precht pascal.precht@gmail.com
Hey @PascalPrecht did you run this against js-ipfs as well as js-ipfs-api to check it passes for go-ipfs as well as js-ipfs? |
Ha good point @alanshaw ! I've only tested this against js-ipfs-api (where it passes). Running this against
So I think though, it'd be better to specify what error we're expecting... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say that ipfs.files.cat
didn't throw an error in this test, wouldn't the test pass? Should probably add a .then(() => throw new Error('Shouldnt be here'))
so in case it's valid, the test fails
@victorbjelkholm Hi and thank you for getting back to me here! Sure, I can add that. Do you also have some thoughts on
By any chance? |
@PascalPrecht can you rebase master onto this branch? |
To verify changes discussed in https://github.com/ipfs/js-ipfs-api/issues/799#issuecomment-402086401, this commit
adds a test that checks
files.cat()
throws a meaningful error when a key or ipfs path withunsupported encoding is given.
License: MIT
Signed-off-by: Pascal Precht pascal.precht@gmail.com