Initial commit
This commit is contained in:
commit
a6272848f9
379 changed files with 74829 additions and 0 deletions
44
build/packages/gleeunit/README.md
Normal file
44
build/packages/gleeunit/README.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# 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",
|
||||
]
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue