@@ -220,3 +220,50 @@ test('formatDate returns en-GB formatted date', () => {
220220 assert . ok ( result . includes ( 'June' ) , `expected "June" in "${ result } "` )
221221 assert . ok ( result . includes ( '2024' ) , `expected "2024" in "${ result } "` )
222222} )
223+
224+ // ── generateLastWords (expanded patterns) ─────────────────────────
225+
226+ test ( '"initial commit" returns beginning quote' , ( ) => {
227+ const repo = buildRepo ( { lastCommitMessage : 'initial commit' , lastCommitDate : new Date ( ) . toISOString ( ) } )
228+ assert . equal ( generateLastWords ( repo ) , 'it was only ever the beginning' )
229+ } )
230+
231+ test ( '"revert" returns nevermind' , ( ) => {
232+ const repo = buildRepo ( { lastCommitMessage : 'revert: undo migration' , lastCommitDate : new Date ( ) . toISOString ( ) } )
233+ assert . equal ( generateLastWords ( repo ) , 'nevermind' )
234+ } )
235+
236+ test ( '"hotfix" returns this is fine' , ( ) => {
237+ const repo = buildRepo ( { lastCommitMessage : 'hotfix: patch auth flow' , lastCommitDate : new Date ( ) . toISOString ( ) } )
238+ assert . equal ( generateLastWords ( repo ) , 'this is fine' )
239+ } )
240+
241+ test ( '"cleanup" returns tidying quote' , ( ) => {
242+ const repo = buildRepo ( { lastCommitMessage : 'cleanup unused imports' , lastCommitDate : new Date ( ) . toISOString ( ) } )
243+ assert . equal ( generateLastWords ( repo ) , 'just tidying up before i go' )
244+ } )
245+
246+ test ( '"bump version" returns release quote' , ( ) => {
247+ const repo = buildRepo ( { lastCommitMessage : 'bump version to 3.0.0' , lastCommitDate : new Date ( ) . toISOString ( ) } )
248+ assert . equal ( generateLastWords ( repo ) , 'one last release into the void' )
249+ } )
250+
251+ test ( '"remove" returns burning the evidence' , ( ) => {
252+ const repo = buildRepo ( { lastCommitMessage : 'remove deprecated API' , lastCommitDate : new Date ( ) . toISOString ( ) } )
253+ assert . equal ( generateLastWords ( repo ) , 'burning the evidence' )
254+ } )
255+
256+ test ( '"refactor" returns architecture quote' , ( ) => {
257+ const repo = buildRepo ( { lastCommitMessage : 'refactor auth module' , lastCommitDate : new Date ( ) . toISOString ( ) } )
258+ assert . equal ( generateLastWords ( repo ) , 'i swear this time the architecture is right' )
259+ } )
260+
261+ test ( '"todo" returns someone else quote' , ( ) => {
262+ const repo = buildRepo ( { lastCommitMessage : 'add todo for error handling' , lastCommitDate : new Date ( ) . toISOString ( ) } )
263+ assert . equal ( generateLastWords ( repo ) , 'someone else will handle it' )
264+ } )
265+
266+ test ( '"dependencies" returns dependency hell' , ( ) => {
267+ const repo = buildRepo ( { lastCommitMessage : 'update dependencies' , lastCommitDate : new Date ( ) . toISOString ( ) } )
268+ assert . equal ( generateLastWords ( repo ) , 'trapped in dependency hell' )
269+ } )
0 commit comments