Skip to content

Instantly share code, notes, and snippets.

@tmikeschu
Created August 18, 2018 19:50
Show Gist options
  • Save tmikeschu/4b61794c3134ec864a522bf37cbc2053 to your computer and use it in GitHub Desktop.
Save tmikeschu/4b61794c3134ec864a522bf37cbc2053 to your computer and use it in GitHub Desktop.
// cat, spaceship, plum
// jump
// hash/object
describe("cat.jump", () => {
let spaceship
let cat
before(() => {
spaceship = createSpaceshipWithPlums()
cat = createCat({ spaceship })
})
it("causes a spaceship to drop a plum", () => {
// we forgot to use the object data type, so I switched spaceship.plums to spaceship.supples,
// which would have keys of supply types pointing to quantity (maybe?!)
const suppliesBefore = spaceship.supplies
cat.jump
const suppliesAfter = spaceship.supplies
const actual = suppliesBefore.plums - suppliesAfter.plums
const expected = 1
expect(actual).toEqual(expected)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment