Bash scripts to help with Elixir testing workflows.
git clone https://github.com/joaothallis/elixir-test-helper.gitSymlink the scripts to a directory already in your PATH:
ln -s "$(pwd)/elixir-test-helper/test_modified_branch_files" /usr/local/bin/
ln -s "$(pwd)/elixir-test-helper/open_coverage" /usr/local/bin/Runs tests for Elixir files modified in the current branch compared to a base branch.
# Default: compare against main
test_modified_branch_files
# With mix test options
test_modified_branch_files --trace --seed 0
# With custom base branch
test_modified_branch_files --base developOpens the coverage HTML file for a given Elixir module.
# From implementation file
open_coverage lib/my_app/users.ex
# From implementation module
open_coverage MyApp.Users
# From test file
open_coverage test/my_app/users_test.exs
# From test module
open_coverage MyApp.UsersTestRequires running mix test --cover first to generate coverage files.
Requires shUnit2.
bash test/test_modified_branch_files_test.sh
bash test/open_coverage_test.shRequires bashcov.
bashcov test/test_modified_branch_files_test.sh && bashcov test/open_coverage_test.shAlternatively, use Nix with flakes to get all dependencies:
nix developMIT