Skip to content

Commit 3a56aaa

Browse files
committed
more tests
1 parent e6ae942 commit 3a56aaa

File tree

4 files changed

+419
-0
lines changed

4 files changed

+419
-0
lines changed

tests/help.test.js

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
/**
2+
* Unit Tests for Help Module
3+
*
4+
* Tests the help text generation functions that provide game documentation
5+
*/
6+
7+
const help = require('../libs/help.js');
8+
9+
describe('Help Module', () => {
10+
describe('playerHelpBasic', () => {
11+
test('should return a string with basic command help', () => {
12+
const result = help.playerHelpBasic();
13+
expect(typeof result).toBe('string');
14+
expect(result.length).toBeGreaterThan(0);
15+
});
16+
17+
test('should include general commands section', () => {
18+
const result = help.playerHelpBasic();
19+
expect(result).toContain('###General Commands###');
20+
});
21+
22+
test('should include babysit command', () => {
23+
const result = help.playerHelpBasic();
24+
expect(result).toContain('babysit');
25+
});
26+
27+
test('should include children command', () => {
28+
const result = help.playerHelpBasic();
29+
expect(result).toContain('children');
30+
});
31+
32+
test('should include give command', () => {
33+
const result = help.playerHelpBasic();
34+
expect(result).toContain('give');
35+
});
36+
37+
test('should include inventory command', () => {
38+
const result = help.playerHelpBasic();
39+
expect(result).toContain('inventory');
40+
});
41+
42+
test('should include scout command', () => {
43+
const result = help.playerHelpBasic();
44+
expect(result).toContain('scout');
45+
});
46+
47+
test('should include vote command', () => {
48+
const result = help.playerHelpBasic();
49+
expect(result).toContain('vote');
50+
});
51+
52+
test('should include status command', () => {
53+
const result = help.playerHelpBasic();
54+
expect(result).toContain('status');
55+
});
56+
57+
test('should include ping command', () => {
58+
const result = help.playerHelpBasic();
59+
expect(result).toContain('ping');
60+
});
61+
});
62+
63+
describe('playerHelpRounds', () => {
64+
test('should return a string with round-based command help', () => {
65+
const result = help.playerHelpRounds();
66+
expect(typeof result).toBe('string');
67+
expect(result.length).toBeGreaterThan(0);
68+
});
69+
70+
test('should include work round commands', () => {
71+
const result = help.playerHelpRounds();
72+
expect(result).toContain('###Work Round Commands###');
73+
});
74+
75+
test('should include food round commands', () => {
76+
const result = help.playerHelpRounds();
77+
expect(result).toContain('Food Round Commands');
78+
});
79+
80+
test('should include reproduction commands', () => {
81+
const result = help.playerHelpRounds();
82+
expect(result).toContain('Reproduction Commands');
83+
});
84+
85+
test('should include guard command', () => {
86+
const result = help.playerHelpRounds();
87+
expect(result).toContain('guard');
88+
});
89+
90+
test('should include craft command', () => {
91+
const result = help.playerHelpRounds();
92+
expect(result).toContain('craft');
93+
});
94+
95+
test('should include gather command', () => {
96+
const result = help.playerHelpRounds();
97+
expect(result).toContain('gather');
98+
});
99+
100+
test('should include hunt command', () => {
101+
const result = help.playerHelpRounds();
102+
expect(result).toContain('hunt');
103+
});
104+
105+
test('should include feed command', () => {
106+
const result = help.playerHelpRounds();
107+
expect(result).toContain('feed');
108+
});
109+
110+
test('should include romance command', () => {
111+
const result = help.playerHelpRounds();
112+
expect(result).toContain('romance');
113+
});
114+
115+
test('should include invite command', () => {
116+
const result = help.playerHelpRounds();
117+
expect(result).toContain('invite');
118+
});
119+
120+
test('should include consent command', () => {
121+
const result = help.playerHelpRounds();
122+
expect(result).toContain('consent');
123+
});
124+
125+
test('should include decline command', () => {
126+
const result = help.playerHelpRounds();
127+
expect(result).toContain('decline');
128+
});
129+
});
130+
131+
describe('playerHelpConflict', () => {
132+
test('should return a string with conflict command help', () => {
133+
const result = help.playerHelpConflict();
134+
expect(typeof result).toBe('string');
135+
expect(result.length).toBeGreaterThan(0);
136+
});
137+
138+
test('should include conflict commands section', () => {
139+
const result = help.playerHelpConflict();
140+
expect(result).toContain('###Conflict Commands###');
141+
});
142+
143+
test('should include demand command', () => {
144+
const result = help.playerHelpConflict();
145+
expect(result).toContain('demand');
146+
});
147+
148+
test('should include faction command', () => {
149+
const result = help.playerHelpConflict();
150+
expect(result).toContain('faction');
151+
});
152+
153+
test('should include attack command', () => {
154+
const result = help.playerHelpConflict();
155+
expect(result).toContain('attack');
156+
});
157+
158+
test('should include defend command', () => {
159+
const result = help.playerHelpConflict();
160+
expect(result).toContain('defend');
161+
});
162+
163+
test('should include run command', () => {
164+
const result = help.playerHelpConflict();
165+
expect(result).toContain('run');
166+
});
167+
});
168+
169+
describe('chiefHelp', () => {
170+
test('should return a string with chief command help', () => {
171+
const result = help.chiefHelp();
172+
expect(typeof result).toBe('string');
173+
expect(result.length).toBeGreaterThan(0);
174+
});
175+
176+
test('should include chief commands section', () => {
177+
const result = help.chiefHelp();
178+
expect(result).toContain('### Chief Commands ###');
179+
});
180+
181+
test('should include induct command', () => {
182+
const result = help.chiefHelp();
183+
expect(result).toContain('induct');
184+
});
185+
186+
test('should include banish command', () => {
187+
const result = help.chiefHelp();
188+
expect(result).toContain('banish');
189+
});
190+
191+
test('should include startwork command', () => {
192+
const result = help.chiefHelp();
193+
expect(result).toContain('startwork');
194+
});
195+
196+
test('should include startfood command', () => {
197+
const result = help.chiefHelp();
198+
expect(result).toContain('startfood');
199+
});
200+
201+
test('should include startreproduction command', () => {
202+
const result = help.chiefHelp();
203+
expect(result).toContain('startreproduction');
204+
});
205+
206+
test('should include migrate command', () => {
207+
const result = help.chiefHelp();
208+
expect(result).toContain('migrate');
209+
});
210+
211+
test('should include decree command', () => {
212+
const result = help.chiefHelp();
213+
expect(result).toContain('decree');
214+
});
215+
216+
test('should include endgame command', () => {
217+
const result = help.chiefHelp();
218+
expect(result).toContain('endgame');
219+
});
220+
221+
test('should include chance command', () => {
222+
const result = help.chiefHelp();
223+
expect(result).toContain('chance');
224+
});
225+
226+
test('should include skip command', () => {
227+
const result = help.chiefHelp();
228+
expect(result).toContain('skip');
229+
});
230+
});
231+
});

tests/messaging.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Unit Tests for Messaging Module
3+
*
4+
* Note: messaging.js is currently an empty placeholder file.
5+
* These tests serve as documentation and a placeholder for future functionality.
6+
*/
7+
8+
describe('Messaging Module', () => {
9+
test('should be importable (module exists)', () => {
10+
// messaging.js is an empty file - this test just confirms it can be imported
11+
expect(() => require('../libs/messaging.js')).not.toThrow();
12+
});
13+
14+
test('placeholder - module is empty', () => {
15+
// This is a placeholder test documenting that messaging.js is empty
16+
// When functionality is added, replace this with actual tests
17+
const messaging = require('../libs/messaging.js');
18+
expect(messaging).toEqual({});
19+
});
20+
});

0 commit comments

Comments
 (0)