@@ -89,6 +89,28 @@ defmodule TransportWeb.BuildTest do
8989 "Your javascript package for #{ dep } is out of date.\n Please update it with:\n \n cd apps/transport/client && yarn upgrade #{ dep } "
9090 end
9191
92+ test "make sure configured _impl and _client modules exist in config.exs" do
93+ # Read config.exs directly to get the production modules (not the test mocks)
94+ config_content = File . read! ( "../../config/config.exs" )
95+
96+ # Extract all _impl and _client configurations with their module values
97+ # Pattern matches lines like: key_impl: Module.Name or key_client: Module.Name,
98+ modules =
99+ Regex . scan ( ~r/ (\w +(?:_impl|_client)):\s +([A-Z][\w .]+)/ , config_content )
100+ |> Enum . map ( fn [ _ , config_key , module_string ] ->
101+ { config_key , String . to_atom ( "Elixir." <> module_string ) }
102+ end )
103+
104+ # Sanity check: ensure we found some configurations
105+ assert length ( modules ) > 15 ,
106+ "Expected to find more than 15 _impl/_client configurations, found #{ length ( modules ) } "
107+
108+ for { config_key , module } <- modules do
109+ assert Code . ensure_loaded? ( module ) ,
110+ "Module #{ inspect ( module ) } configured for #{ config_key } in config.exs does not exist"
111+ end
112+ end
113+
92114 # figuring out you have forgotten to upgrade the assets can be tricky, so we add a little reminder here
93115 test "make sure LiveView client assets are up to date" do
94116 { output , 0 } = System . cmd ( "yarn" , [ "list" , "--pattern" , "phoenix_live_view" ] , cd: "client" )
0 commit comments