Skip to content

Instantly share code, notes, and snippets.

@tmaybe tmaybe/ Secret
Last active Apr 17, 2017

What would you like to do?

Set-up Instructions

  • Clone this gist to your computer
    • git clone git+ssh:// rover-node
    • cd rover-node
  • Move rover_test.js in to a folder named test in the same directory as rover.js to start
    • mkdir test
    • mv rover_test.js test
  • Install dependencies (mocha, for running tests)
    • npm install
  • Run the tests to verify that everything's set up correctly
    • mocha test/rover_test.js

Build Instructions

We're going to build the API for a Mars rover using a test-driven approach. Some things that the rover could do:

* know which compass direction it is facing
* know where it is relative to its landing position
* move forward
* turn left and right
* follow a list of single-character commands (f,l,r)
* move backward (b)
* sense whether there is an obstacle
* refuse to move forward if the path is blocked
* anything else you think would be interesting
"name": "rover-node",
"version": "1.0.0",
"description": "Mars rover kata in javascript",
"main": "rover.js",
"directories": {
"test": "test"
"dependencies": {
"mocha": "^3.2.0"
"devDependencies": {},
"scripts": {
"test": "mocha"
"repository": {
"type": "git",
"url": "git+ssh://"
"author": "",
"license": "",
"bugs": {
"url": ""
"homepage": ""
exports.Rover = function() { = function() {
return true;
var assert = require("assert");
var rover = require("../rover.js");
describe('Rover', function() {
describe('exists', function () {
it('should respond to ping', function () {
var my_rover = new rover.Rover();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.