mocha , ava 这种单测库看了眼 dependencies 就不想用了,太笨重,尤其是用到 browser 里的时候。
很多侵入式设计,各种全局变量,有洁癖的人完全无法忍受。
于是自己撸了个超轻量的库:
https://github.com/ysmood/junit# Features
- Supports both Node.js and old browsers
- Should work well from ES3 to ES7
- Make it super easy to concurrently test async functions, designed for `async-await`
- Automatically garbage collect the unhandled error
- Full customizable report style
- Not a single global variable pollution
- Only one dependency, light weight and behavior predictable