Just before the contribution policy change, I’ve created a test that should cover an edge case which a great portion of the community solutions do not cover.
Link to original PR: here
By accident, I’ve chosen a battery and trackDistance combination that actually does not trigger the wrong behavior. I wanted to fix this test case in a new PR, but this is not possible anymore.
This issue would be fixed with the following test:
{
name: "Car has 60% battery. Car cannot finish the race",
car: Car{
speed: 3,
batteryDrain: 3,
battery: 60,
},
trackDistance: 61,
expected: false,
},
instead of this one:
{
name: "Car has 50% battery. Car cannot finish the race",
car: Car{
speed: 3,
batteryDrain: 3,
battery: 50,
},
trackDistance: 51,
expected: false,
},