open-screeps icon indicating copy to clipboard operation
open-screeps copied to clipboard

Test stubbing package.

Open Arcath opened this issue 7 years ago • 1 comments

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:
    • creep1 which has:
      • fatigue: 1
      • carry.energy: 100
      • carry.power: 200
      • body....
      • spawning: true
      • move() 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.

Arcath avatar Jan 18 '18 13:01 Arcath

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.

RiftLurker avatar Feb 01 '18 09:02 RiftLurker