UNPKG

doggo-quest-logic

Version:

The game logic for the Doggo Quest text-based game sample project

35 lines (34 loc) 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const StoryEngine_1 = require("../../StoryEngine"); const Room_1 = require("../Room"); describe('On Chair', () => { let engine; beforeEach(() => { engine = new StoryEngine_1.StoryEngine(); engine.state.isCrateOpen = true; engine.state.currentRoom = Room_1.Room.UnderCouch; }); describe('navigation', () => { it('Should allow navigation to the living room', () => { const response = engine.getResponseState('go out'); expect(response.state.currentRoom).toBe(Room_1.Room.Living); }); }); describe('room', () => { it('Lists objects', () => { const response = engine.getResponse('look'); expect(response).toContain('dark'); expect(response).toContain('couch'); expect(response).toContain('exit'); }); }); describe('couch', () => { it('Looks different', () => { expect(engine.getResponse('look at couch')).toContain('different'); }); it('Smells like mommy and daddy', () => { expect(engine.getResponse('smell couch')).toContain('mommy'); }); }); });