3 ms·
I think there is a case to be made that unit tests can live inside the file under test; integration tests can live outside of it. Also, mocks are arguably a te
by pmarreck 10y ago
I think there is a case to be made that unit tests can live inside the file under test; integration tests can live outside of it.
Also, mocks are arguably a test-code-smell side effect of too little isolation: https://www.destroyallsoftware.com/blog/2014/test-isolation-is-about-avoiding-mocks https://www.destroyallsoftware.com/blog/2014/test-isolation-...
In my Elixir one-page code experiments, I put the unit test in the same file after the code under test. It makes sure the test only runs when the file is loaded a certain way: https://github.com/pmarreck/elixir-snippets/ https://github.com/pmarreck/elixir-snippets/