简体   繁体   中英

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.?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM