Skip to content

Instantly share code, notes, and snippets.

@jasongorman

jasongorman/rover_test.js Secret

Created Sep 26, 2020
Embed
What would you like to do?
[{input: "N", expected: "E"}, {input: "E", expected: "S"}, {input: "S", expected: "W"},
{input: "W", expected: "N"}].forEach(
function (testCase) {
it("turns right", () => {
let rover = {facing: testCase.input};
rover = go(rover, "R");
assert.equal(rover.facing, testCase.expected);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment