{"id":18000119,"url":"https://github.com/maxohq/maxo_test_iex","last_synced_at":"2025-03-26T07:32:01.306Z","repository":{"id":152458276,"uuid":"626102350","full_name":"maxohq/maxo_test_iex","owner":"maxohq","description":"Simple and interactive ExUnit runner","archived":false,"fork":false,"pushed_at":"2024-08-15T21:12:05.000Z","size":58,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-21T11:09:45.780Z","etag":null,"topics":["elixir","elixir-lang"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxohq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-10T19:58:21.000Z","updated_at":"2024-08-15T21:12:08.000Z","dependencies_parsed_at":"2024-10-29T23:40:08.149Z","dependency_job_id":null,"html_url":"https://github.com/maxohq/maxo_test_iex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxohq%2Fmaxo_test_iex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxohq%2Fmaxo_test_iex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxohq%2Fmaxo_test_iex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxohq%2Fmaxo_test_iex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxohq","download_url":"https://codeload.github.com/maxohq/maxo_test_iex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245611733,"owners_count":20643886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-lang"],"created_at":"2024-10-29T23:09:43.321Z","updated_at":"2025-03-26T07:32:00.924Z","avatar_url":"https://github.com/maxohq.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/maxohq/maxo_test_iex/actions/workflows/ci.yml/badge.svg?style=flat)](https://github.com/maxohq/maxo_test_iex/actions/workflows/ci.yml)\n[![Hex.pm](https://img.shields.io/hexpm/v/maxo_test_iex.svg?style=flat)](https://hex.pm/packages/maxo_test_iex)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg?style=flat)](https://hexdocs.pm/maxo_test_iex/)\n[![Total Downloads](https://img.shields.io/hexpm/dt/maxo_test_iex.svg?style=flat)](https://hex.pm/packages/maxo_test_iex)\n[![Licence](https://img.shields.io/hexpm/l/maxo_test_iex.svg?style=flat)](https://github.com/maxohq/maxo_test_iex/blob/main/LICENCE)\n\n# TestIex\n\nTestIex is an interactive ExUnit test runner, that provides following features:\n\n- Easy to learn:\n\n  - the public API consists of 3 functions:\n    - TestIex.run(matcher // \"\")\n    - TestIex.run(matcher, line)\n    - TestIex.watch(matcher // \"\")\n    - TestIex.watch(matcher, line)\n    - TestIex.unwatch()\n\n- Rapid feedback:\n\n  - since there is no re-incurring cost of starting an OS process with Elixir + Mix + your code for every run\n\n- With sensible defaults:\n\n  - you won't have to spend a lot of time to get it configured. Default configs provide great experience for the majority of Elixir projects\n\n- Usable\n\n  - File event de-duplication during watch mode means you only run tests once, even if there are rapid multiple consecutive file events for a single file\n\n- Robust\n\n  - it does code recompilation + loading of tests in a predictable manner\n\n- Flexible:\n\n  - should you have some special needs, there are config options to tune.\n  - they are all conveniently kept in a single module [TestIex.Config](https://github.com/maxohq/maxo_test_iex/blob/main/lib/test_iex/config.ex).\n  - heck, you could even swap the TestIex.Core module, if desired! It exposes only 3 public functions:\n    - start()\n    - test(files)\n    - test(file, line)\n\n- Inspectable\n\n  - you can turn on debug logs to see what happens\n  - this helps you to narrow down issues with your configuration\n\n- Support for test file co-location:\n\n  - it comes with support for co-located ExUnit tests out of the box!\n  - Examples of real-life projects using co-located test files\n    - https://github.com/maxohq/maxo_adapt/blob/main/lib/maxo_adapt_test.exs\n  - To configure co-located test you'll need to adjust following files\n\n    - https://github.com/maxohq/maxo_adapt/blob/main/mix.exs (test_paths, test_pattern)\n    - create a test helper in `lib`: https://github.com/maxohq/maxo_adapt/blob/main/lib/test_helper.exs\n\n  - Now you're running!\n  - This pattern is very common in Golang / JS / TypeScript and we think it should be also more common in the Elixir community.\n\n- Low - tech:\n\n  - it does not require a particular editor extension or similar. Just simple Elixir + ExUnit in your terminal.\n  - your workflow wont have to change in future, since the foundation for TestIex is very stable:\n    - ExUnit + file system watching + Iex\n\n- Maintainable:\n\n  - since it requires very little code, it's very easy to maintain and adjust on new Elixir releases\n  - the core is in [TestIex.Core](https://github.com/maxohq/maxo_test_iex/blob/main/lib/test_iex/core.ex).\n  - It is less than 40 lines of Elixir code with lots of docs.\n  - besides it does not have any hairy GenServer logic and also has no ambitions to grow more features and become more complex\n  - by not supporting umbrella projects, we keep the code complexity much lower\n  - every Elixir project is considered to be in a single root folder with\n    following directories under it:\n    - `lib`\n    - `test`\n\nPlease give it a try and see if you like it!\n\n## Usage\n\n```elixir\n$ MIX_ENV=test iex -S mix\n\n# Run all tests\niex\u003e TestIex.run\n\n# Run all matching files\niex\u003e TestIex.run(\"word\")\n\n# Run test on line 45 for the first matching file\niex\u003e TestIex.run(\"word\", 45)\n\n# Run test on line 45 for the first matching file\niex\u003e TestIex.run(\"users_test.exs:45\")\n\n# Run test on line 45 for the first matching file\niex\u003e TestIex.run(\"users:45\")\n\n# Watching on file changes and re-running tests.\n# Currently only .ex / .exs files in `lib` or `test` folders trigger a re-run.\niex\u003e TestIex.watch(\"users:45\")\n\n# Reset watching\niex\u003e TestIex.unwatch()\n```\n\n## Configuration\n\n```elixir\n# in config/runtime.exs\nimport Config\n\nif config_env() == :test do\n  # for default values look into:\n  # - https://github.com/maxohq/maxo_test_iex/blob/main/lib/test_iex/config.ex\n\n  # NO need to watch for tests on CI\n  if System.get_env(\"CI\"), do: config :maxo_test_iex, watcher_enable: false\n\n  # how long multiple consecutive events on the same file should be considered duplicates?\n  config :maxo_test_iex, watcher_dedup_timeout: 500\n\n  # which file changes should trigger a test re-run?\n  config :maxo_test_iex, watcher_args: [dirs: [\"lib/\", \"test/\"], latency: 0]\n\n  # which file extensions are relevant to trigger a test re-run?\n  config :maxo_test_iex, watcher_extensions: [\".ex\", \".exs\"]\n\n  # should we log debug messages?\n  config :maxo_test_iex, debug: false\nend\n```\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:maxo_test_iex, \"~\u003e 0.1\", only: [:test]},\n  ]\nend\n```\n\n## Alternatives\n\n- https://hex.pm/packages/test_iex (the core is take from this project and was extended / improved)\n- https://hex.pm/packages/tix\n- https://hex.pm/packages/mix_test_watch\n- https://hex.pm/packages/mix_test_interactive\n- https://github.com/marciol/mix_test_iex\n- https://hex.pm/packages/mr_t\n\n## Support\n\n\u003cp\u003e\n  \u003ca href=\"https://quantor.consulting/?utm_source=github\u0026utm_campaign=maxo_test_iex\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/maxohq/sponsors/main/assets/quantor_consulting_logo.svg\"\n      alt=\"Sponsored by Quantor Consulting\" width=\"210\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\nThe lib is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxohq%2Fmaxo_test_iex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxohq%2Fmaxo_test_iex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxohq%2Fmaxo_test_iex/lists"}