Skip to content

Commit

Permalink
add integration test to verify duplicate IDs works
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Dec 4, 2023
1 parent 6bfb1c1 commit e9ef6d0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/inngest/function.ex
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ defmodule Inngest.Function do
Optional timezone prefix, e.g. `TZ=Europe/Paris 0 12 * * 5`.
"""
alias Inngest.{Config, Trigger}
alias Inngest.Function.{Context, Input, Step}
alias Inngest.Function.{Context, Input}

@doc """
Returns the function's human-readable ID, such as "sign-up-flow"
Expand Down
25 changes: 25 additions & 0 deletions test/inngest/function/cases/loop_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
defmodule Inngest.Function.Cases.LoopTest do
use ExUnit.Case, async: true

alias Inngest.Test.DevServer
import Inngest.Test.Helper

@default_sleep 5_000

@tag :integration
test "should calculate sum correctly" do

Check failure on line 10 in test/inngest/function/cases/loop_test.exs

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.15 / OTP 25.3)

test should calculate sum correctly (Inngest.Function.Cases.LoopTest)
event_id = send_test_event("test/plug.loop")
Process.sleep(@default_sleep)

assert {:ok,
%{
"data" => [
%{
"run_id" => _run_id,
"output" => 30,
"status" => "Completed"
}
]
}} = DevServer.run_ids(event_id)
end
end

0 comments on commit e9ef6d0

Please sign in to comment.