https://github.com/lpil/gleeunit
Gleam bindings for the Erlang EUnit test framework
https://github.com/lpil/gleeunit
erlang eunit gleam testing
Last synced: about 1 month ago
JSON representation
Gleam bindings for the Erlang EUnit test framework
- Host: GitHub
- URL: https://github.com/lpil/gleeunit
- Owner: lpil
- License: apache-2.0
- Created: 2021-10-31T14:07:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T12:51:46.000Z (10 months ago)
- Last Synced: 2025-03-16T07:11:21.178Z (8 months ago)
- Topics: erlang, eunit, gleam, testing
- Language: Erlang
- Homepage:
- Size: 52.7 KB
- Stars: 27
- Watchers: 3
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-gleam - gleeunit - [📚](https://hexdocs.pm/gleeunit/) - Gleam bindings to Erlang's EUnit test framework (Packages / Testing)
README
# gleeunit
A simple test runner for Gleam, using EUnit on Erlang and a custom runner on JS.
[](https://hex.pm/packages/gleeunit)
[](https://hexdocs.pm/gleeunit/)
```sh
gleam add gleeunit@1 --dev
```
```gleam
// In test/yourapp_test.gleam
import gleeunit
pub fn main() {
gleeunit.main()
}
```
Now any public function with a name ending in `_test` in the `test` directory
will be found and run as a test.
```gleam
pub fn some_function_test() {
assert some_function() == "Hello!"
}
```
Run the tests by entering `gleam test` in the command line.
### Deno
If using the Deno JavaScript runtime, you will need to add the following to your
`gleam.toml`.
```toml
[javascript.deno]
allow_read = [
"gleam.toml",
"test",
"build",
]
```