feat: include responses from Exceptions

This commit is contained in:
Justin Lin committed 2025-04-21 12:31:53 +08:00
1 parent 0f0f43b838
commit 254e4f75ed
3 files changed
+18 -13

No files matched your search

+15
View File
@@ -43,6 +43,19 @@ const quest: IQuest = {
response: { type: 'narrative', content: 'Narrative 4' },
},
],
exceptions: [
{
id: 'exception1',
condition: {
command: 'rm',
},
response: {
type: 'narrative',
content: 'Exception 1',
},
requirements: [],
},
],
}
describe('Session', () => {
@@ -108,9 +121,11 @@ describe('Session', () => {
},
])
session.complete('exception1')
session.complete('stage2')
expect(session.getResponses()).toEqual([
{ type: 'narrative', content: 'Narrative 1' },
{ type: 'narrative', content: 'Exception 1' },
{ type: 'narrative', content: 'Narrative 2' },
])
})