Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpil/gleeunit
Gleam bindings for the Erlang EUnit test framework
https://github.com/lpil/gleeunit
erlang eunit gleam testing
Last synced: 12 days 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 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-26T10:28:39.000Z (4 months ago)
- Last Synced: 2024-10-13T22:54:56.849Z (25 days ago)
- Topics: erlang, eunit, gleam, testing
- Language: Erlang
- Homepage:
- Size: 49.8 KB
- Stars: 22
- Watchers: 3
- Forks: 17
- 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
Gleam bindings to the Erlang EUnit test framework.
A custom test runner is included for when compiled to JavaScript running on
either NodeJS or Deno.Documentation is available on [HexDocs](https://hexdocs.pm/gleeunit/index.html).
## Usage
Add this package to your Gleam project.
```sh
gleam add gleeunit --dev
```And then call the `gleeunit.main` function from your test main function.
```gleam
// In test/yourapp_test.gleam
import gleeunitpub 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 the_universe_test() {
let assert 1 = 1
}
```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",
]
```