https://github.com/eulixir/json_response
A better response formatter in json for your tests
https://github.com/eulixir/json_response
elixir json
Last synced: about 1 month ago
JSON representation
A better response formatter in json for your tests
- Host: GitHub
- URL: https://github.com/eulixir/json_response
- Owner: eulixir
- License: apache-2.0
- Created: 2021-07-19T11:14:49.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-20T19:53:50.000Z (almost 5 years ago)
- Last Synced: 2025-11-30T09:20:16.713Z (7 months ago)
- Topics: elixir, json
- Language: Elixir
- Homepage:
- Size: 8.79 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JsonResponse
Formatter Json para testes em Elixir
Adicionar no `test_helper.exs`
```elixir
ExUnit.configure formatters: [ExUnit.CLIFormatter, JsonResponse]
```
Adicionar o Arquivo do formater de preferência na pasta `support` e adicionar a configuração no `mix.exs` para carregar a pasta junto com os testes
```elixir
defp elixirc_paths(:test), do: ["lib", "test/support"]
```
Exemplo:
```json
{
"excluded": [],
"failed": [
{
"describe": "by_id/1",
"file": "/media/miticos/HD/github/json_response/test/exmoveit/users/get_test.exs",
"line": 10,
"module": "Elixir.Exmoveit.Users.GetTest",
"test": "test by_id/1 When id exist, returns the user"
}
],
"invalid": [],
"passed": [
{
"describe": "changeset/1",
"file": "/media/miticos/HD/github/json_response/test/exmoveit/user_test.exs",
"line": 14,
"module": "Elixir.Exmoveit.UserTest",
"test": "test changeset/1 When all params are valid, returns a valid changeset"
}
]
}
```