Weird problem with multiple interpreter services... #1313
-
Sorry if this isn't the appropriate place to ask this, but I can't seem to understand why this is happening. I have a RoomMachine and in my Jest tests I make sure to recreate a new interpreter for each test. However it seems as though all of these are somehow linked together (i.e. pointing to the same variable), resulting in failed tests. I've created a small unit test to demonstrate a weird bit of behaviour:
The output of this when run in jest is:
I'm expecting only service1 to have the spectator data... For some reason, sending an event to Here's the test file: LINK Here's the file containing the machine: LINK I'm using the NestJS framework with Jest, but that shouldn't be a problem I hope... Do you guys have any suggestions on what I could try to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Seems like you're doing it here: context.spectators.push(event.player); As well as a few other places, probably. |
Beta Was this translation helpful? Give feedback.
context
!Seems like you're doing it here:
As well as a few other places, probably.