Skip to content
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

Merged
merged 3 commits into from
Sep 22, 2016
Merged

Add tape support #29

merged 3 commits into from
Sep 22, 2016

Conversation

adamyonk
Copy link
Contributor

@adamyonk adamyonk commented Sep 13, 2016

#28

  • Add Tape to Readme
  • Add Tape docs page with usage examples
  • Add Tests for tape
  • Add Tests with tape as a step to npm test

@adamyonk
Copy link
Contributor Author

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');
Copy link
Member

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

@dmitry-zaets
Copy link
Member

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

@dmitry-zaets
Copy link
Member

For tests you can check tests for other frameworks in test
Folder

@adamyonk
Copy link
Contributor Author

There aren't any special functions for tape like should has (.withState, .dispatchActions), so do you mean you just want me to include tape and make sure that a test finishes using the plain JS assertions?

@dmitry-zaets
Copy link
Member

Yep, exactly, just check that tests are finishing with assertions

});
});
});
});
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'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.

Copy link
Member

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.

@dmitry-zaets
Copy link
Member

dmitry-zaets commented Sep 14, 2016

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.

@adamyonk
Copy link
Contributor Author

OK, finally got around to cleaning those up. Let me know if you want anything else!

@dmitry-zaets
Copy link
Member

Awesome!

@dmitry-zaets dmitry-zaets merged commit bb925b4 into redux-things:master Sep 22, 2016
@dmitry-zaets
Copy link
Member

Thanks a lot for a contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants