Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 16, 2019 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/5441ca6ae4139b96da555d242088730c to your computer and use it in GitHub Desktop.
Save jasongorman/5441ca6ae4139b96da555d242088730c to your computer and use it in GitHub Desktop.
const quote = require("../../src/tell_dont_ask/carpet_quote");
test("quote for carpet without rounding up", () => {
const room = {length: 2.5, width: 2.5};
const carpet = {pricePerSqrMetre: 10.0, roundUp: false};
expect(quote(room, carpet)).toBe(62.5);
})
test("quote for carpet with rounding up", () => {
const room = {length: 2.5, width: 2.5};
const carpet = {pricePerSqrMetre: 10.0, roundUp: true};
expect(quote(room, carpet)).toBe(70.0);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment