-
Notifications
You must be signed in to change notification settings - Fork 300
Start implementing browser tests using karma #78
Conversation
@victorbjelkholm nearly done with all your listed todos ;) |
At the moment the |
i dont see the logging output from |
All done @diasdavid @victorbjelkholm please give this a code review :) |
@@ -0,0 +1,75 @@ | |||
module.exports = function (config) { | |||
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) { |
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.
I'll need this to be able to run in local? I think this should be optional
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.
Right, not sure of the best way to do that, suggestions?
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.
Extract the SauceLabs specific parts that only get added if process.env.SAUCE_USERNAME
and SAUCE_ACCESS_KEY
is set would be a simple way to achieve it.
this is awesome! Thank you @dignifiedquire and @victorbjelkholm ! :D I'm getting 2 tests fail though, one might be related with being in a slow wifi, but the other (when daemon stops) shouldn't throw. Am I the only one seeing this? » npm test ◉ ◼◼◼◼◼◼◼◼◼◼
> [email protected] test /Users/david/Documents/code/ipfs/node-ipfs-api
> npm run test:node && npm run test:browser
> [email protected] test:node /Users/david/Documents/code/ipfs/node-ipfs-api
> mocha
ipfs node api
# ipfs node setup
# ipfs init done
# ipfs daemon running
✓ has the api object
✓ add file
✓ add buffer
- add path
✓ cat
1) ls
✓ config set/get
✓ block.put
✓ block.get
✓ object.put
✓ object.get
✓ object.data
- refs
✓ id
- returns an error when getting a non-existent key from the DHT
- puts and gets a key value pair in the DHT
2) test for error after daemon stops
11 passing (16s)
4 pending
2 failing
1) ipfs node api ls:
Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
2) ipfs node api test for error after daemon stops:
Error: the object {
"Code": 0
"Message": "context canceled"
"uncaught": true
} was thrown, throw an Error :)
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "run" "test:node"
npm ERR! node v4.2.0
npm ERR! npm v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test:node: `mocha`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] test:node script 'mocha'.
npm ERR! This is most likely a problem with the ipfs-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! mocha
npm ERR! You can get their info via:
npm ERR! npm owner ls ipfs-api
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/david/Documents/code/ipfs/node-ipfs-api/npm-debug.log
npm ERR! Test failed. See above for more details. |
@diasdavid run them a couple of times, no idea they sometimes work and sometimes fail for me I think it's not dependent on this api but rather on ipfs answering fast enough. Maybe the daemon checks should be separated out or so. |
Question posted on IRC:
Also, running npm run test:browser throws because it is not using a disposable Node:
|
@dignifiedquire @victorbjelkholm would you mind if I add a branch to node-ipfs-api that we all can work in (giving you perm) to do the PR to master, so that we don't have to create forks to PR into @dignifiedquire fork so that it gets PR'ed into master? |
sure thing |
Awesome! :) Check #81 closing this one :) |
Ref #77
test:node
test:browser