Undefined function inside of a test

Hi

I made a unit test in order to compare two lists but it’s returning the following error:

== Compilation error in file test/prepend_test.exs ==
** (CompileError) test/prepend_test.exs:1: undefined function test/2
    (elixir 1.10.3) lib/kernel/parallel_compiler.ex:396: Kernel.ParallelCompiler.require_file/2
    (elixir 1.10.3) lib/kernel/parallel_compiler.ex:306: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

to_list and stream_lines lines aren’t undefined… So what’s the reason of the error?

Code: https://github.com/LauraBeatris/prepend_cli/blob/master/test/prepend_test.exs

you need to define your test inside a:

defmodule MyTest do
  use ExUnit.Case

  (...)
end
1 Like

Thanks!

1 Like