Where should I write unit test cases for my module?

I have a module that’s used in frontend app (and maybe the backend too).
Should I write the test cases inside the module or in the application that uses that module?

What’s the best practice?