Skip to content

Instantly share code, notes, and snippets.

@lgandecki
Created June 21, 2019 09:33
Show Gist options
  • Save lgandecki/506db2f054a4e09c41f59542fbae6e6f to your computer and use it in GitHub Desktop.
Save lgandecki/506db2f054a4e09c41f59542fbae6e6f to your computer and use it in GitHub Desktop.
const { estimateShipping } = require("./estimateShipping");
test("estimateShipping should be 0 for an item with a price over 1000", () => {
expect(estimateShipping({price: 1001})).toEqual(0)
});
test("estimateShipping should be calculated as 1 dollar per 2 pounds for an item with a price of 1000 or below", () => {
expect(estimateShipping({price: 1000, weight: 500})).toEqual(250)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment