afternow

afternow

"expected ExUnit callback" while running Absinthe Tests

Hello

I create a graphql API according to the book “Craft graphql apis in elixir with absinthe”.

When I create tests, I run into an error:

  1) test Category field returns category items (BiidiWeb.Schema.Query.CategoryTest)
 test/biidi_web/schema/query/category_test.ex:15
 ** (RuntimeError) expected ExUnit callback in BiidiWeb.Schema.Query.CategoryTest to return :ok | keyword | map, got %Biidi.Category{__meta

__: #Ecto.Schema.Metadata<:loaded, “categories”>, id: 4, inserted_at: ~N[2018-09-18 20:19:16.469878], title: “other”, updated_at: ~N[2018-09-18
20:19:16.469890]} instead
stacktrace:
(ex_unit) lib/ex_unit/callbacks.ex:368: ExUnit.Callbacks.raise_merge_failed!/2

I searched in Google and in the Forum, but cause I’m new in Elixir and Phoenix I don’t get a propper understanding of the occurring issue.

Here is a working dockerized copy reduced to the failing part:
https://gitlab.com/birdnestman/biidi_test

You can run docker-compose, create DB, migration and then run the test…

Thank you for any help!

Marked As Solved

afternow

afternow

Got it. The error appears in the “setup do”

I forgot to add
“:ok”
to the end of the seeds file…

Also Liked

ijunaidfarooq

ijunaidfarooq

life saver.

Last Post!

afternow

afternow

If you only need it for that particular test, i suggest to use a fixture too for the states.

If you want to use different seeds in general, have a look at this post: How to seed database for testing? - #3 by ThrashAbaddon

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New