What does tags mean?

Hi all

Can someone please explain me what the tags mean here?

  setup tags do
    {:ok, conn: Phoenix.ConnTest.build_conn()}
  end

Thanks

1 Like

Read this:

http://blog.simonstrom.xyz/elixir-testing-tag-tests-in-exunit/

usually it’s called “context” not “tags” because it is basically current test metadata that can be set either by testing framework/lib or you, manually, specifying tag.

2 Likes

The argument to setup is the “test context” which contains all metadata for the currently running test [1]. Tests can be tagged and those tags will live in the context [2].

[1] https://hexdocs.pm/ex_unit/ExUnit.Case.html#module-context
[2] https://hexdocs.pm/ex_unit/ExUnit.Case.html#module-tags

3 Likes

That link is dead. Here’s an archived version for anyone else who stumbles on this thread: