Have a Javascript test suite inside a phoenix project

Good morning!!

It will probably be a silly questions but, If you want to implement several modules with functions in Javascript and you want to test them, how you would implement that?

I guess it would be something like

  1. Install a test framework (like Jest)
  2. Put them somewhere
  3. Create a mix task for running the test

I am asking that because I have 0 experience with Frontend/Javascript/Phoenix so if someone has done something similar before it would be very helpful

Thank you :heart:

  • Create a mix task for running the test

I wouldn’t try to make everything executable from mix, unless you have a good reason to do so. Jest has its own CL tool to run the tests, so I would run the elixir tests from mix and the front-end tests from jest, with 2 separate commands. If any of these commands fails, your test pipeline has failed :slight_smile: