Skip to content

Commit

Permalink
add integration test for invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed May 28, 2024
1 parent d4c96e9 commit 6a113bf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions test/inngest/function/cases/invoke_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
defmodule Inngest.Function.Cases.InvokeTest do
use ExUnit.Case, async: true

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

@default_sleep 5_000

@tag :integration
test "should run successfully" do
event_id = send_test_event("test/invoke.caller")
Process.sleep(@default_sleep)

assert {:ok,
%{
"data" => [
%{
"output" => %{"data" => "INVOKED!"},
"run_id" => _,
"status" => "Completed"
}
]
}} = DevServer.run_ids(event_id)
end
end
2 changes: 1 addition & 1 deletion test/support/cases/invoke_fn.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Inngest.Test.Case.InvokeCallerFn do
step.invoke(ctx, "caller", %{
function: Inngest.Test.Case.InvokedFn,
data: %{yolo: true},
timeout: "5m"
timeout: "10s"
})

{:ok, res}
Expand Down

0 comments on commit 6a113bf

Please sign in to comment.