diff --git a/README.md b/README.md index 465ea05..65c2682 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ Run `mix test test/path/to/file_test.exs` or `npm run test:jest -- js/path/to/fi See [`bin/test`](bin/test), [`mix.exs`](mix.exs), and [`package.json`](package.json) for other test commands. +To see code coverage, run `mix test --cover` or `npm run test:jest -- --coverage`. These generate `lcov.info` files which can be viewed with tools like the VSCode extension "Coverage Gutters". + ## Docker To run the Docker container locally, run `docker compose up --build`. diff --git a/mix.exs b/mix.exs index 038b4e8..77c0232 100644 --- a/mix.exs +++ b/mix.exs @@ -15,7 +15,8 @@ defmodule Orbit.MixProject do deps: deps(), dialzyer: [ plt_add_apps: [:mix] - ] + ], + test_coverage: [tool: LcovEx] ] end @@ -65,6 +66,7 @@ defmodule Orbit.MixProject do depth: 1}, {:httpoison, "== 2.2.1"}, {:jason, "== 1.4.4"}, + {:lcov_ex, "== 0.3.3", only: [:test], runtime: false}, {:logster, "== 2.0.0-rc.3"}, {:oban, "== 2.18.3"}, {:phoenix, "== 1.7.14"}, diff --git a/mix.lock b/mix.lock index b872530..2604817 100644 --- a/mix.lock +++ b/mix.lock @@ -32,6 +32,7 @@ "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "jose": {:hex, :jose, "1.11.10", "a903f5227417bd2a08c8a00a0cbcc458118be84480955e8d251297a425723f83", [:mix, :rebar3], [], "hexpm", "0d6cd36ff8ba174db29148fc112b5842186b68a90ce9fc2b3ec3afe76593e614"}, + "lcov_ex": {:hex, :lcov_ex, "0.3.3", "1745a88e46606c4f86408299f54878b7d0cd22ea3e9c54b0018b6ed631a9ce87", [:mix], [], "hexpm", "ea373ec4d2df213357c5a464be16ab08d1e58e61ea2de784a483780c22a1e74a"}, "logster": {:hex, :logster, "2.0.0-rc.3", "0edcafd1433e305ff3a3a4ce8b1a3b78697e165a39e9d1f20e6fb7d038e9bda1", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "4dbcd4f7d0bc2d681c400a70364ae6b2f07b214c06b865730b00f22c55dd4e0f"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},