3 ms·
If you're looking for a minimalist framework that can be learned in 10 minutes or so, I recommend "ospec". For me it was a delight compared with Jest. https:/
by jonahx 3y ago
If you're looking for a minimalist framework that can be learned in 10 minutes or so, I recommend "ospec". For me it was a delight compared with Jest.
https://github.com/MithrilJS/ospec https://github.com/MithrilJS/ospec
- yawnxyz 3y agoWow that's so refreshingly simple. Do you have any recommended / official tutorials or cookbooks for this, for web projects?
- jonahx 3y agoAs far the library itself goes, the README is all you need to know. That's what's great. It does assume familiarity with testing in general (ie, how to design for unit testing, how to write clear tests, etc), but you'll need that to use any testing library effectively, and that skill is orthogonal to the library itself. If you're looking for resources on that, I recommend: https://github.com/testdouble/contributing-tests/wiki/London-school-TDD https://github.com/testdouble/contributing-tests/wiki/London...
- fourthark 3y agoI like that ospec does away with the `it(...)` convention in favor of “bullets” “It” always caused weird grammatical problems with test descriptions. You can’t always describe tests that way. Some authors would try and some would ignore “it”.
- conaclos 3y agoNice project! I will have a look at it. I recently tried `bun:test` [1], which aims to become a drop-in replacement for Jest. It is quite good, but there is no way to do test coverage at the moment [2]. I am not sure that it will be fixed soon, as to my knowledge there is no test coverage instrumentation on JSC. I replaced AVA with a minimal testing lib called Oletus [3]. It was also a delight compared to AVA. I am currently one of the maintainers of Oletus. [1] https://bun.sh/docs/cli/test https://bun.sh/docs/cli/test [2] https://github.com/oven-sh/bun/issues/3158 https://github.com/oven-sh/bun/issues/3158 [3] https://github.com/bearror/oletus https://github.com/bearror/oletus
- Jarred 3y agobun test will get test coverage. I recently learned about a JSC api that lets you see which functions have been called or not called. There’s a “control flow profiler”. Just need to wire it up.