Skadoosh
Skadoosh

Reputation: 715

How to write ExUnit test cases in elixir for an escript project

I have an escript project done in Elixir using mix. The project has two or three .ex files that needs to be executed using certain arguments using the "escript" command It is like a client server based project where one escript run, starts the server(that keeps running) and a another escript run (in another terminal) connects to the server and does operations.

How to write a test script using ExUnit (and run using mix run test) and call the client functions in the test file after starting server.?

Upvotes: 0

Views: 185

Answers (1)

Paweł Obrok
Paweł Obrok

Reputation: 23194

I think the way I would recommend is to have the actual escript be a very thin wrapper around some Elixir module. That way you can just test the module itself and the amount of code that is untested will be very small.

Upvotes: 1

Related Questions