@@ -15,15 +15,14 @@ func TestBuildToolDescription(t *testing.T) {
1515 }{
1616 {
1717 name : "All modules enabled" ,
18- enabledModules : []string {"console" , "fs" , "http" , "fetch" , " timers" , "process" , "require" },
18+ enabledModules : []string {"console" , "fs" , "http" , "timers" , "process" , "require" },
1919 expectedContent : []string {
2020 "simplified JavaScript VM (goja)" ,
2121 "NOT a full Node.js environment" ,
2222 "📦 Available modules:" ,
2323 "• console: Console logging" ,
2424 "• fs: File system operations" ,
2525 "• http: HTTP server creation" ,
26- "• fetch: HTTP client requests" ,
2726 "• timers: Timer functions" ,
2827 "• process: Process information" ,
2928 "• require: Module loading system" ,
@@ -44,7 +43,6 @@ func TestBuildToolDescription(t *testing.T) {
4443 notExpected : []string {
4544 "• fs:" ,
4645 "• http:" ,
47- "• fetch:" ,
4846 "• process:" ,
4947 "• require:" ,
5048 },
@@ -64,17 +62,16 @@ func TestBuildToolDescription(t *testing.T) {
6462 },
6563 },
6664 {
67- name : "Only fetch enabled" ,
68- enabledModules : []string {"fetch " },
65+ name : "Only timers enabled" ,
66+ enabledModules : []string {"timers " },
6967 expectedContent : []string {
7068 "📦 Available modules:" ,
71- "• fetch: HTTP client requests (fetch API with Promise support for GET/POST/etc) " ,
69+ "• timers: Timer functions " ,
7270 },
7371 notExpected : []string {
7472 "• console:" ,
7573 "• fs:" ,
7674 "• http:" ,
77- "• timers:" ,
7875 "• process:" ,
7976 "• require:" ,
8077 },
@@ -101,7 +98,7 @@ func TestBuildToolDescription(t *testing.T) {
10198func TestToolDescriptionDynamicUpdate (t * testing.T ) {
10299 // Test that different configurations produce different descriptions
103100 config1 := ModuleConfig {EnabledModules : []string {"console" , "fs" }}
104- config2 := ModuleConfig {EnabledModules : []string {"fetch" , " timers" }}
101+ config2 := ModuleConfig {EnabledModules : []string {"timers" }}
105102
106103 server1 , err := NewJSServerWithConfig (config1 )
107104 assert .NoError (t , err )
@@ -120,11 +117,9 @@ func TestToolDescriptionDynamicUpdate(t *testing.T) {
120117 // Config1 should mention console and fs
121118 assert .Contains (t , desc1 , "• console:" )
122119 assert .Contains (t , desc1 , "• fs:" )
123- assert .NotContains (t , desc1 , "• fetch:" )
124120 assert .NotContains (t , desc1 , "• timers:" )
125121
126- // Config2 should mention fetch and timers
127- assert .Contains (t , desc2 , "• fetch:" )
122+ // Config2 should mention timers
128123 assert .Contains (t , desc2 , "• timers:" )
129124 assert .NotContains (t , desc2 , "• console:" )
130125 assert .NotContains (t , desc2 , "• fs:" )
0 commit comments