Code Contribution docs - Testing

Hi guys! I’m reviewing/documenting all the information needed for Code Contributions. I’ve already created some drafts in the WIKI

I’m currently working on explaining how the test are implemented and organized in Frontity repo
I’ve seen there are some packages with a __tests__ folder and some other that doesn’t have it
Is this because some packages cannot be tested for some reasons or is this just something that is in the Roadmap but hasn’t been done yet due to other priorities?

Also, the location of the __tests__ folder varies in some packages (some is in the root of the package, some is under src folder, …). this doesn’t really matter, right? Is there any recommendation then?

Are there any guidelines or helpers we can offer to the contributors so it’s easier for them to add new tests when opening their PR?

I’ve seen there are some packages with a tests folder and some other that doesn’t have it
Is this because some packages cannot be tested for some reasons or is this just something that is in the Roadmap but hasn’t been done yet due to other priorities?

I’d say that unit test coverage is quite good in Frontity and if some parts don’t have is because it didn’t make sense.

Also, the location of the tests folder varies in some packages (some is in the root of the package, some is under src folder, …). this doesn’t really matter, right? Is there any recommendation then?

We try to keep the tests close to the tested files:

  • Code: src/folder/code.js
  • Tests: src/folder/__tests__/code.test.js

But it is not enforced.

Are there any guidelines or helpers we can offer to the contributors so it’s easier for them to add new tests when opening their PR?

I don’t think we have anything written down yet.