open-screeps
open-screeps copied to clipboard
Test stubbing package.
I'm repeating myself in a few packages with my stubbings which isn't really necessary.
If we create @open-screeps\tests-stub it could provide:
- All the constants
- A selection of creeps e.g:
creep1which has:fatigue: 1carry.energy: 100carry.power: 200- body....
spawning: truemove()alwayrs returns ERR_TIRED
- etc....
- A selection of Rooms
- A copy of functions that dont use storage e.g.
getLinearDistance
It would then be usable by players to do testing in their own AI and us in open-screeps packages.
I don't think a predefined selection of rooms and room objects (like creeps) is a good idea, as tests might want to check for different environments. Simple functions to create proper instances of them sounds like a good idea though. I'm going to give this another thought and come back with some ideas.