Commit db154d89 authored by Stefanie Hasler's avatar Stefanie Hasler

tcr

parent 573a93dc
......@@ -4,14 +4,23 @@ class MarsRover {
x: number = 0
y: number = 0
dir: 'N' = 'N'
public pos() {
return `${this.x},${this.y},${this.dir}`
}
north() {
this.y++
return this
}
}
describe("MarsRover", () => {
it('should output starting position', () => {
expect(new MarsRover().pos()).to.equal('0,0,N')
})
it('should move north', () => {
expect(new MarsRover().north().pos()).to.equal('0,1,N')
})
})
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment