How to handle __tests__ style subdirectories in bsconfig.json


#1

Is there a way to make bs-config.json honor the Jest style directories?

Meaning that any subdirectory that begins with __tests__ to only be compiled with dev dependencies.

For eample if your directories look like this:

src/components
├── App
│   ├── App.re
│   ├── AppContainer.re
│   └── __tests__
│       └── AppTest.re
├── Aux
│   ├── Aux.re
│   └── __tests__
│       └── AuxTest.re

Only stuff under __tests__ (AuxTest.re and AppTest.re) would be compiled as “dev”, the rest would be normal. So far looking at the config it doesn’t seem this is possible. I would like to have my tests to my code if possible (nice to have).


#2

bsb is fast enough that I don’t tend to worry about it. It might be worth opening an issue if there is no existing solution, though.


#3

I’m more concerned about bundle size. Perhaps I should…


#4

I don’t think that will affect the bundle size at all. As long as you don’t require the test files anywhere.