@@ -102,13 +102,15 @@ defmodule ElixirScript.E2eTest.EndToEndUtils do
102
102
alias ElixirScript.ScriptRunner
103
103
104
104
def run_test ( % Entry { name: name , file: nil , script: script , expected: expected } ) do
105
- actual =
106
- run_script_and_capture_output ( script )
107
- |> convert_to_github_actions_output ( )
105
+ { output , io } = run_script_and_capture_output ( script )
106
+ actual = convert_to_github_actions_output ( output )
108
107
109
108
unless is_nil ( expected ) do
110
109
assert actual == expected ,
111
- "E2E test '#{ name } ' failed.\n Expected: #{ inspect ( expected ) } \n Actual: #{ inspect ( actual ) } "
110
+ "E2E test '#{ name } ' failed.\n " <>
111
+ " EXPECTED:\n #{ inspect ( expected ) } \n \n " <>
112
+ " ACTUAL:\n #{ inspect ( actual ) } \n \n " <>
113
+ " LOGS:\n #{ io } "
112
114
end
113
115
end
114
116
@@ -119,13 +121,14 @@ defmodule ElixirScript.E2eTest.EndToEndUtils do
119
121
# the return value back to the parent process. This ensures that only the intended return
120
122
# value is used for the test assertion, regardless of any other IO produced during script execution.
121
123
defp run_script_and_capture_output ( script ) do
122
- capture_io ( fn ->
123
- actual = ScriptRunner . run ( script )
124
- send ( self ( ) , { :actual , actual } )
125
- end )
124
+ io =
125
+ capture_io ( fn ->
126
+ output = ScriptRunner . run ( script )
127
+ send ( self ( ) , { :output , output } )
128
+ end )
126
129
127
- assert_received { :actual , actual }
128
- actual
130
+ assert_received { :output , output }
131
+ { output , io }
129
132
end
130
133
131
134
# Converts the script output to match the GitHub Actions output format.
0 commit comments