Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliapluto/plutotest.jl
✔️ Visual, reactive testing library for Julia. Time machine included.
https://github.com/juliapluto/plutotest.jl
debugging julia julia-language pluto-notebooks testing time-travel
Last synced: 26 days ago
JSON representation
✔️ Visual, reactive testing library for Julia. Time machine included.
- Host: GitHub
- URL: https://github.com/juliapluto/plutotest.jl
- Owner: JuliaPluto
- License: mit
- Created: 2021-05-02T20:29:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T15:20:27.000Z (6 months ago)
- Last Synced: 2024-10-12T19:21:38.851Z (26 days ago)
- Topics: debugging, julia, julia-language, pluto-notebooks, testing, time-travel
- Language: Julia
- Homepage: https://juliapluto.github.io/PlutoTest.jl/src/notebook.html
- Size: 2.71 MB
- Stars: 82
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PlutoTest.jl _(alpha release)_
> _Visual, reactive testing library for Julia_
A macro `@test` that you can use to verify your code's correctness. **But instead of just saying _"Pass"_ or _"Fail"_, let's try to show you _why_ a test failed.**
- ✨ _time travel_ ✨ to replay the execution step-by-step
- ⭐️ _multimedia display_ ⭐️ to make results easy to read---
![Demo screencap](https://user-images.githubusercontent.com/6933510/116827035-60f4cf00-ab97-11eb-9dd9-631426e435af.gif)
[Try this demo in your browser](https://juliapluto.github.io/PlutoTest.jl/src/notebook.html)
# Install & use
First, update Pluto to at least `0.15`! That's it, Pluto will automatically install the package when you `import`/`using` it.
Inside your notebook, use the `@test` macro to test whether something returns `true`:
```julia
julia> using PlutoTestjulia> @test 1 + 1 == 2
```This package is still an _alpha release_, don't use it to `@test is_safe(crazy_new_bike_design)`.
# Reactive
This testing library is designed to be used inside Pluto.jl, a **reactive** notebook. If you write your tests in the same notebook as your code, then Pluto will automatically re-run the affected tests after you make a change. Tests that are unaffected will not need to re-run. Neat!
### Navigation
When a test gets re-run and it fails outside of your viewport, you will be notified with a red dot on the edge of the screen. You can click on a dot to jump to the test, multiple dots indicate multiple tests.
![](https://user-images.githubusercontent.com/6933510/116827278-74ed0080-ab98-11eb-89be-f808429ed942.gif)
_(Only enabled on Chrome and Firefox for now.)_
# Future: GitHub Action
In the future, it will be easy to run Pluto-based, PlutoTest-based tests automatically on GitHub Actions or Travis CI. In addition to running your tests, it will **upload a rendered notebook** as artifact to the test run ([sample](https://juliapluto.github.io/PlutoTest.jl/src/notebook.html)). If a test failed, you can open the notebook and see why.
# How does it work?
Take a look at the [source code](https://juliapluto.github.io/PlutoTest.jl/src/notebook.html)! (It's a Pluto notebook 🌝)