Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Unreleased
==========

* feat: File throttling to prevent files being compiled multiple times in quick succession and tests being run multiple times due to one "change".
* feat: by default clear the screen before each test run (configurable with `clear_before_running_tests`)

0.5.0 / 2018-05-01
==================
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ config :cortex,
disabled: {:system, "CI_RUN", false}
```

## Configuring

```ex
config :cortex,
clear_before_running_tests: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the fence about defaulting this to true since it feels like it might be a kind of jarring change. @russmatney @rschmukler thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm mostly indifferent. The readme and changelog document the change well, so, anyone coming from an old version should be able to see what happened easily. Subjectively, I also prefer screen clearing on refresh, so I'd say :shipit:

```

Set `clear_before_running_tests` to clear the screen immediately before running tests, defaults to true.

## Phoenix

If you are running a phoenix application,
Expand Down
3 changes: 2 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ use Mix.Config
# import_config "#{Mix.env}.exs"
config :cortex,
enabled: {:system, "CORTEX_ENABLED", true},
disabled: {:system, "CORTEX_DISABLED", false}
disabled: {:system, "CORTEX_DISABLED", false},
clear_before_running_tests: true
4 changes: 4 additions & 0 deletions lib/cortex/test_runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ defmodule Cortex.TestRunner do
# present
if focus == nil, do: clear_focus()

if Application.get_env(:cortex, :clear_before_running_tests, true) do
IEx.Helpers.clear()
end

files_to_load = [test_helper | files]

compiler_errors =
Expand Down