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

Write unit tests #29

Open
digilou opened this issue Apr 6, 2018 · 2 comments
Open

Write unit tests #29

digilou opened this issue Apr 6, 2018 · 2 comments
Labels

Comments

@digilou
Copy link
Collaborator

digilou commented Apr 6, 2018

Even a small scale app should have tests written for it. In this case, TDD (test-driven dev) would work, unless you want to go BDD (behavior-driven dev). Jest is a popular library to use right now. If you don't want to go with all-the-things Facebook, Mocha is another option.

One perk of tests, it helps you think about what the user is trying to accomplish or expect, and helps keep your functions smaller.

@ddcornwall
Copy link
Owner

This seems like a good time to embrace best practice. I admit at the current time I don't know the difference between TDD and BDD. I have HEARD of Unit testing and may have watched a video or two but didn't sink in at the time. Can you recommend a good resource for learning more on this topic?

@digilou
Copy link
Collaborator Author

digilou commented Apr 6, 2018

Well, I've only really practiced with Rails, which can go TDD or BDD. More Rails devs lean BDD and use RSpec or Cucumber. Tutorials naturally cover this because it's just the Rails way. I need to research for JS apps. I like BDD because you think in terms of what actions the user is taking. TDD is more robotic to make sure this function works a specific way.

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

No branches or pull requests

2 participants