@@ -7,7 +7,6 @@ defmodule ElixirScript.E2eTest do
7
7
import Mox
8
8
9
9
alias ElixirScript.E2e
10
- alias ElixirScript.E2eTest.Runner
11
10
alias Test.Fixtures.GitHubWorkflowRun
12
11
13
12
setup :verify_on_exit!
@@ -54,6 +53,29 @@ defmodule ElixirScript.E2eTest do
54
53
end
55
54
end
56
55
56
+ defp create_temp_file ( content ) do
57
+ tmp_dir = System . tmp_dir ( )
58
+ file_path = Path . join ( tmp_dir , "temp.exs" )
59
+ File . write! ( file_path , inspect ( content ) )
60
+ on_exit ( fn -> File . rm! ( file_path ) end )
61
+ file_path
62
+ end
63
+ end
64
+
65
+ defmodule ElixirScript.E2eTest.EndToEndTest do
66
+ @ moduledoc """
67
+ This module contains unit tests for the E2e module's functionality,
68
+ ensuring that the test file reading and parsing behaviors are working as expected.
69
+ """
70
+ use ExUnit.Case
71
+ import Mox
72
+
73
+ alias ElixirScript.E2e
74
+ alias ElixirScript.E2eTest.EndToEndUtils
75
+ alias Test.Fixtures.GitHubWorkflowRun
76
+
77
+ setup :verify_on_exit!
78
+
57
79
describe "end-to-end tests" do
58
80
test "run e2e tests" do
59
81
stub ( SystemEnvMock , :get_env , fn varname , default ->
@@ -63,20 +85,12 @@ defmodule ElixirScript.E2eTest do
63
85
stub ( TentacatMock.ClientMock , :new , fn -> % { auth: nil , endpoint: "github" } end )
64
86
65
87
E2e . read_test_file ( )
66
- |> Enum . each ( & Runner . run_test / 1 )
88
+ |> Enum . each ( & EndToEndUtils . run_test / 1 )
67
89
end
68
90
end
69
-
70
- defp create_temp_file ( content ) do
71
- tmp_dir = System . tmp_dir ( )
72
- file_path = Path . join ( tmp_dir , "temp.exs" )
73
- File . write! ( file_path , inspect ( content ) )
74
- on_exit ( fn -> File . rm! ( file_path ) end )
75
- file_path
76
- end
77
91
end
78
92
79
- defmodule ElixirScript.E2eTest.Runner do
93
+ defmodule ElixirScript.E2eTest.EndToEndUtils do
80
94
@ moduledoc """
81
95
This submodule focuses on running end-to-end tests and validating their output against expected results.
82
96
"""
0 commit comments