hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
38.86k stars 4.76k forks source link

Introducing test utils #3119

Open ertrzyiks opened 6 years ago

ertrzyiks commented 6 years ago

Not a problem this time, but I would like to share an idea. It's something I was working on during last weeks.

I've seen and use a lot of nice plugins to Hexo, but only few are automatically tested. With Hexo is very easy to write test for plugin, but the boilerplate code needed for it may discourage to try.

To improve the situation and ease adding specs for plugins I came up with hexo-test-utils. It's a Sandbox and set of utilities. Currently, it has only those I needed for https://github.com/hexojs/hexo-filter-responsive-images . It could and should have way more.

The documenation for the current API is here

@NoahDragon if you like the idea, I will move the repo to the organization

ertrzyiks commented 6 years ago

@hexojs/core any thoughts on that?

I'm still actively developing those utils, plan to add more documentation which would be also a nice introduction to Hexo internals I think. Would you and your plugins/themes benefit from such a library?