Open lorenzosinisi opened 4 years ago
Hey @lorenzosinisi ! ESpec itself also has both exunit and espec tests. What I do (locally and in CI) is just running two commands: ‘mix test’ and ‘mix espec’. See ‘.travis.yml’ file.
aright, thank you :) I was looking for a way to run both but maybe an alias would do the trick here
Hey @antonmi! Is it possible to replace exunit with espec?
Hey @alec-c4 ! Not sure, if I got your question. ESpec is an alternative test framework for Elixir. You can rewrite your tests using ESpec. You can do the transition gradually, using both exunit and espec.
@antonmi I'll try to explain. If you've worked with Ruby on Rails before, you maybe know that you can create an application with key
-T, [--skip-test], [--no-skip-test] # Skip test files
Which allows you to create app without tests, then use rspec with. Unfortunately, there are no similar option in Phoenix, so we are unable to create project without ex_unit and to use espec instead. That's why I'm askin' 'bout complete replacement of exunit with espec
@alec-c4 ! Got it. Yeah, phoenix creates default configs for ExUnit, however it doesn't force you to use ExUnit. Just delete test folder and setup ESpec
Hello @antonmi , what is the best way to run ExUnit tests with an app that also has espec files?
I am trying to figure it out because I am working on an application which has one exunit file (an planning to add more) and some espec files. What is the best way to configure and run them both? or even with different commands?
I tried the following:
mix cmd --app app_name mix test file_name_test.exs
but of course no success as it compains about ExUnit not being started