Skip to content

eulixir/json_response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonResponse

Formatter Json para testes em Elixir

Adicionar no test_helper.exs

  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

  defp elixirc_paths(:test), do: ["lib", "test/support"]

Exemplo:

{
  "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"
    }
  ]
}

About

A better response formatter in json for your tests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages