-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tape support #29
Add tape support #29
Conversation
I added some docs and stubbed out a test for tape, but I wasn't sure what exactly you want tested - we're really just using the plain JavaScript assertions here. |
|
||
// using CommonJS modules | ||
var test = require('tape') | ||
var assertions = require('redux-actions-assertions'); |
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 guess we have a mistake here in js docs, should be:
var assertions = require('redux-actions-assertions').assertions;
Needs to be changed also in ja version
In section for Tape we can just say that it is the same as javascript, but there are two parts that needs to be done to: use t.pass and t.fail callbacks, use t.plan or .then with t.end |
For tests you can check tests for other frameworks in test |
There aren't any special functions for |
Yep, exactly, just check that tests are finishing with assertions |
}); | ||
}); | ||
}); | ||
}); |
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'm a little stuck on why these tests won't pass, maybe you can give me some direction. I'm calling done
in a couple different ways here to try and figure out what's going on, but only the first test ever passes. It seems like the other two are getting hung up on a promise somewhere, but I'm having trouble debugging. Test 1 and test 2 are the same, I was just trying to call done in different ways to figure out what's up.
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.
You are having problems because you are mixing mocha with tape, both are testing frameworks with own expectations, etc. Just use tape in those tests and it will work.
Would be cool to have a full workflow with tape, including tests only with tape without mocha, like: test('timing test', function (t) {
t.plan(2);
t.equal(typeof Date.now, 'function');
var start = Date.now();
setTimeout(function () {
t.equal(Date.now() - start, 100);
}, 100);
}); And tape runner: "test:tape": "tape -r babel-register test/tape/*.js", By having this we will ensure that clean tape workflow works as expected. |
OK, finally got around to cleaning those up. Let me know if you want anything else! |
Awesome! |
Thanks a lot for a contribution! |
#28