#175

New

lesson on testing

Reported by Volkan Ozcelik on JavaScript: from Zero to Hero · 14/07/2018 06:54:14

Assigned to:
Volkan Ozcelik
Priority:
Normal
Status:
New
Category:
Lessons
Version:
None

dump from slack

never written a test in my life, what should I use?

If you want something popular and getting traction try `jest` jestjs.io

Jest is based on `jasmine`, so if for some reason you like the syntax but it does not quite suit you you can try its elder sister jasmine.github.io

mocha is pretty solid too. No problem using it. Especially Mocha + Chai + Sinon ( www.npmjs.com/package/mocha www.chaijs.com sinonjs.org ) combo goes long ways.

If you ask me, each test framework is a glorified facade over simpler `assert` functions. So more important than which framework to use is to get the mindset of TDD/BDD and think about “what” to test and “how” to test it, if/what to mock, how to design integration tests (along with unit tests); is testing UI an overkill that’s better delegated to selenium etc.

In short. Pick one popular framework and go for it.
All popular frameworks provide the same things: The only thing changes is their “flavor”, and also community support.

That said, I’d give `jest` a go ;)

Attachments

No attachment has been uploaded, yet.


Loading comments...