All Projects β†’ lpil β†’ Mix Test.watch

lpil / Mix Test.watch

Licence: other
🎠 Because TDD is awesome

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Mix Test.watch

Mockk
mocking library for Kotlin
Stars: ✭ 4,214 (+484.47%)
Mutual labels:  tdd
Goss
Quick and Easy server testing/validation
Stars: ✭ 4,550 (+531.07%)
Mutual labels:  tdd
React Tdd Guide
A series of examples on how to TDD React
Stars: ✭ 585 (-18.86%)
Mutual labels:  tdd
Wp Browser
Easy acceptance, functional, integration and unit testing for WordPress plugins, themes and sites using Codeception.
Stars: ✭ 391 (-45.77%)
Mutual labels:  tdd
Bash unit
bash unit testing enterprise edition framework for professionals
Stars: ✭ 419 (-41.89%)
Mutual labels:  tdd
Chutzpah
Chutzpah is an open source JavaScript test runner which enables you to run unit tests using QUnit, Jasmine, Mocha and TypeScript.
Stars: ✭ 549 (-23.86%)
Mutual labels:  tdd
Ava
Node.js test runner that lets you develop with confidence πŸš€
Stars: ✭ 19,458 (+2598.75%)
Mutual labels:  tdd
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (-8.18%)
Mutual labels:  tdd
Mocha
β˜•οΈ simple, flexible, fun javascript test framework for node.js & the browser
Stars: ✭ 20,986 (+2810.68%)
Mutual labels:  tdd
Redux Webpack Es6 Boilerplate
A starter project for modern React apps with Redux
Stars: ✭ 566 (-21.5%)
Mutual labels:  tdd
Fff
A testing micro framework for creating function test doubles
Stars: ✭ 396 (-45.08%)
Mutual labels:  tdd
Clean React
Sistema em ReactJs usando Hooks, Typescript, TDD, Clean Architecture, Design Patterns e SOLID principles
Stars: ✭ 408 (-43.41%)
Mutual labels:  tdd
Jasmine Matchers
Write Beautiful Specs with Custom Matchers for Jest and Jasmine
Stars: ✭ 552 (-23.44%)
Mutual labels:  tdd
Testfx
MSTest V2 framework and adapter
Stars: ✭ 391 (-45.77%)
Mutual labels:  tdd
Clean Ts Api
API em NodeJs usando Typescript, TDD, Clean Architecture, Design Patterns e SOLID principles
Stars: ✭ 619 (-14.15%)
Mutual labels:  tdd
Shellspec
A full-featured BDD unit testing framework for bash, ksh, zsh, dash and all POSIX shells
Stars: ✭ 375 (-47.99%)
Mutual labels:  tdd
Ut
UT: C++20 ΞΌ(micro)/Unit Testing Framework
Stars: ✭ 507 (-29.68%)
Mutual labels:  tdd
Vue Testing Handbook
A guide on testing Vue components and applications
Stars: ✭ 669 (-7.21%)
Mutual labels:  tdd
Awesome Swift Korean Lecture
ν›Œλ₯­ν•œ Swift μ„Έμ…˜ λ™μ˜μƒ(κ°•μ’Œ), ν•œκΈ€ μžλ§‰μžˆλŠ” ν˜Ήμ€ ν•œκ΅­μ–΄ κ°•μ˜ 정보 링크 λͺ¨μŒ (Awesome Swift Korean lecture information)
Stars: ✭ 649 (-9.99%)
Mutual labels:  tdd
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+647.99%)
Mutual labels:  tdd

mix test.watch

Build Status Module Version Hex Docs Total Download License Last Updated

Automatically run your Elixir project's tests each time you save a file.

Because Test-driven development (TDD) is awesome.

Usage

Add it to your dependencies:

For Elixir 1.4 onwards:

# mix.exs
def deps do
  [
    {:mix_test_watch, "~> 1.0", only: :dev, runtime: false}
  ]
end

For Elixir 1.3 and earlier:

# mix.exs
def deps do
  [
    {:mix_test_watch, "~> 1.0", only: :dev}
  ]
end

Run the mix task:

mix test.watch

Start hacking :)

Running Additional Mix Tasks

Through the mix config it is possible to run other mix tasks as well as the test task. For example, if I wished to run the Dogma code style linter after my tests I would do so like this.

# config/config.exs
use Mix.Config

if Mix.env == :dev do
  config :mix_test_watch,
    tasks: [
      "test",
      "dogma",
    ]
end

Tasks are run in the order they appear in the list, and the progression will stop if any command returns a non-zero exit code.

All tasks are run with MIX_ENV set to test.

Passing Arguments To Tasks

Any command line arguments passed to the test.watch task will be passed through to the tasks being run. If I only want to run the tests from one file every time I save a file I could do so with this command:

mix test.watch test/file/to_test.exs

Note that if you have configured more than one task to be run these arguments will be passed to all the tasks run, not just the test command.

Running tests of modules that changed

Elixir 1.3 introduced --stale option that will run only those test files which reference modules that have changed since the last run. You can pass it to test.watch:

mix test.watch --stale

Clearing The Console Before Each Run

If you want mix test.watch to clear the console before each run, you can enable this option in your config/dev.exs as follows:

# config/config.exs
use Mix.Config

if Mix.env == :dev do
  config :mix_test_watch,
    clear: true
end

Excluding files or directories

To ignore changes from specific files or directories just add exclude: regexp patterns to your config in mix.exs:

# config/config.exs
use Mix.Config

if Mix.env == :dev do
  config :mix_test_watch,
    exclude: [~r/db_migration\/.*/,
              ~r/useless_.*\.exs/]
end

The default is exclude: [~r/\.#/, ~r{priv/repo/migrations}].

Compatibility Notes

On Linux you may need to install inotify-tools.

Desktop Notifications

You can enable desktop notifications with ex_unit_notifier.

Alternatives

mix_test_interactive is based on mix test.watch but adds an interactive mode that allows you to dynamically change which tests to run.

Copyright and Licence

mix test.watch

Copyright Β© 2015 Louis Pilfold

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].