You can use the filter:<templateName>.build hooks. For the category page it would be filter:category.build, for a topic page it would be filter:topic.build and so on.
How to unit test plugins during developoment?
If I'm developing a plugin for NodeBB, what is the recommended way to write unit tests for the plugin?
Has anyone done this who would like to share his workflow?
Do you mean you want to do integration testing? Running your plugin in a live NobeBB?
Unit tests would use a mocks (fake functions that always return expected results) to call nodebb and db methods.
Shard last edited by
I've had similar issues trying to meet things up with the style guide.
@yariplus Yes, integration testing especially. Is there any resource on how to do it with NodeBB and its plugins?
Not particularly... there's no exposure to the testing suite via plugins.
If you want to test the plugin via eslint, you can run it locally: