@@ -8,7 +8,9 @@ describe('config_file.setup', function()
88
99 before_each (function ()
1010 original_schedule = vim .schedule
11- vim .schedule = function (fn ) fn () end
11+ vim .schedule = function (fn )
12+ fn ()
13+ end
1214 original_api_client = state .api_client
1315 config_file .config_promise = nil
1416 config_file .project_promise = nil
@@ -33,16 +35,15 @@ describe('config_file.setup', function()
3335 end ,
3436 }
3537
36- config_file .setup ()
3738 -- Promises should not be set up during setup (lazy loading)
3839 assert .falsy (config_file .config_promise )
3940 assert .falsy (config_file .project_promise )
40-
41+
4142 -- Accessing config should trigger lazy loading
4243 local resolved_cfg = config_file .get_opencode_config ()
4344 assert .same (cfg , resolved_cfg )
4445 assert .True (get_config_called )
45-
46+
4647 -- Project should be loaded when accessed
4748 local project = config_file .get_opencode_project ()
4849 assert .True (get_project_called )
@@ -57,7 +58,6 @@ describe('config_file.setup', function()
5758 return Promise .new ():resolve ({ id = ' p1' })
5859 end ,
5960 }
60- -- No need to call setup() since config is loaded lazily
6161 local agents = config_file .get_opencode_agents ()
6262 assert .True (vim .tbl_contains (agents , ' custom' ))
6363 assert .True (vim .tbl_contains (agents , ' build' ))
@@ -74,7 +74,6 @@ describe('config_file.setup', function()
7474 return Promise .new ():resolve (project )
7575 end ,
7676 }
77- -- No need to call setup() since project is loaded lazily
7877 local proj = config_file .get_opencode_project ()
7978 assert .same (project , proj )
8079 end )
0 commit comments