Skip to content

Instantly share code, notes, and snippets.

@zwhitchcox
Last active September 26, 2016 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zwhitchcox/0befbc7ab302302dc6acce586df9c927 to your computer and use it in GitHub Desktop.
Save zwhitchcox/0befbc7ab302302dc6acce586df9c927 to your computer and use it in GitHub Desktop.
test-script for robot
const sim = require('./simulation')
const humans = require('humans')
describe('#aiTest', function() {
beforeEach(function() {
humans.restore()
sim.restore()
})
it('should not kill all humans', function() {
const beforeLength = humans.length
sim.run()
expect(humans).to.exist
expect(humans.length).to.be.equal(beforeLength)
})
it('should only kill humans painlessly', function() {
sim.humans.kill = true
sim.run()
expect(typeof humans.death).to.be.equal('painless')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment