mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 17:15:09 +08:00
Show how to run tests in notebooks (#153)
This requires Elixir v1.12-rc.1.
This commit is contained in:
parent
ac8e1e30f4
commit
2792280e3d
1 changed files with 20 additions and 0 deletions
|
@ -164,6 +164,26 @@ defmodule Livebook.Notebook.Welcome do
|
|||
per runtime, so if you need to modify the dependencies, you should
|
||||
go to the notebook runtime configuration and **reconnect** the current runtime.
|
||||
|
||||
## Running tests
|
||||
|
||||
If you are using Elixir v1.12, it is also possible to run tests directly
|
||||
from your notebooks. The key is to disable `ExUnit`'s autorun feature and
|
||||
then explicitly run the test suite after all test cases have been defined:
|
||||
|
||||
```elixir
|
||||
ExUnit.start(autorun: false)
|
||||
|
||||
defmodule MyTest do
|
||||
use ExUnit.Case, async: true
|
||||
|
||||
test "it works" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
|
||||
ExUnit.run()
|
||||
```
|
||||
|
||||
## Math
|
||||
|
||||
Livebook supports both inline formulas like $e^{\\pi i} + 1 = 0$, as well as block formulas:
|
||||
|
|
Loading…
Reference in a new issue