We have a custom theme for our NodeBB installation, and after every deployment, composer plugin breaks, here is how it looks. To make it properly work, we have to go to admin panel and manually re-order our plugins such that our theme is at the end of the plugins list. Is there a way out? Or is there a way to automate it? Thanks
Muhammad Saqib
Posts
-
I need to re-order my plugins manually after every deployment, is there a way out? -
How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?@PitaJ said in How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?:
The process is too difficult to really describe here, it might be easier to just implement a feature where tests can be run than explain how to do it yourself.
So I will have to create a PR to NodeBB core for this feature? There seems not to be another way?
-
How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?@Muhammad-Saqib said in How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?:
@PitaJ Actually I have a custom theme, which has extended the core router and there are a few endpoints which I want to write tests for. What I am not being able to figure out is that how I can load my custom theme when I run npm run test in NodeBB directory so that I could run tests for my custom endpoints. Please note that my theme is child of nodebb-theme-persona, can you please help me with this? Thanks
Anybody who can respond? @julian
-
How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?@PitaJ said in How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?:
Your plugin will need to be activated for the routes and sockets and stuff to work, though.
@PitaJ Actually I have a custom theme, which has extended the core router and there are a few endpoints which I want to write tests for. What I am not being able to figure out is that how I can load my custom theme when I run
npm run test
in NodeBB directory so that I could run tests for my custom endpoints. Please note that my theme is child ofnodebb-theme-persona
, can you please help me with this? Thanks -
How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?@PitaJ said in How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?:
The way this has to be done is having the NodeBB test run the tests of your plugin.
This doesn't work either if your plugin/theme is having
module.parent.require
calls inside them. Any other solution? -
How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries? -
How can I require core NodeBB modules inside my test files, supposed to be executed using mocha/jest binaries?I have to write unit tests for our custom plugins, and the tests files will be run with jest/mocha binaries. The problem is that I cannot
require
NodeBB core modules inside my test files to mock/stub them. I have tried bothrequire.main.require
andmodule.parent.require
, and get the "Cannot find module" error. Is there a way to do so? -
Why I am getting HTTP Head requests against my NodeBB installation?Hey @julian, can you please help with the above? Thanks
-
Why I am getting HTTP Head requests against my NodeBB installation?I am getting a lot of HTTP
HEAD
requests against some of the endpoints on my NodeBB instance, here are a few of them:head /category/:category_id/:slug?
head /topic/topic_id/:slug/:post_index?
I wonder why I am getting these requsts with the
HEAD
method, and given there are no handlers for these requests? Can anybody help? Thanks