momi-foundation-coding/nodejs-api-cli

Improve folder structure for tests -> all tests in one file

Closed this issue ยท 9 comments

  • At the moment, when app is created, there is only one test file, where it holds all tests.
  • It is better to have controller testing, middlewares or other items be in their own folder.
  • Also, it should make sure that tests are running.

Hi @ezkemboi can I have a go at this please?

Sure, thanks and welcome.
Go ahead and rais a PR.

Assigned to you @its-tayo.

Hi @ezkemboi, can you please let me know what the new test directory structure should look like?

Something like

    tests 
        - controllers
              - user.js
        - middleware
             - middleware.js
        - routes
             - routes.js

It might not be good the first time, but the idea is to have different files/folders for different parts that are testable. Something like models might be tested easily when controllers and other items have been tested.
We just want to get rid of the test file being a single file.

In case of any clarification you need or help with the codebase, do let me know.
Looking forward to your PR.

@its-tayo we can schedule a call if you need assistance with any part of the codebase or any assistance whatsoever.

Alright, thanks. I went through the codebase thoroughly yesterday, hence the delay. Submitting my pr in a bit. But we could still schedule a call though.

@its-tayo thanks for your efforts.
I do really appreciate and welcome to the team.
Probably about the call, I will send you an email on the same.

You're welcome. Looking forward to our call.