Skip to content

Commit

Permalink
Adding unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed May 6, 2018
1 parent ef9ce1f commit 5751a8a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/billing.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { calculateCost } from "../libs/billing-lib";

test("Lowest tier", () => {
const storage = 10;

const cost = 4000;
const expectedCost = calculateCost(storage);

expect(cost).toEqual(expectedCost);
});

test("Middle tier", () => {
const storage = 100;

const cost = 20000;
const expectedCost = calculateCost(storage);

expect(cost).toEqual(expectedCost);
});

test("Highest tier", () => {
const storage = 101;

const cost = 10100;
const expectedCost = calculateCost(storage);

expect(cost).toEqual(expectedCost);
});

0 comments on commit 5751a8a

Please sign in to comment.