Skip to content

Commit

Permalink
Add tests for db connector
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdobler committed Jul 4, 2019
1 parent dc95da7 commit e70df6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/batteries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ beforeEach(() => {
trigger.mockClear();
});

window.XMLHttpRequest = function() {
window.XMLHttpRequest = function () {
let xhr = {
open: jest.fn(),
send: jest.fn(),
Expand All @@ -30,6 +30,13 @@ describe("db cause", () => {
});
});

describe("db connector", () => {
it("should return the state of db", () => {
db.reset({ foo: "bar" });
expect(connect("db")).toStrictEqual({ foo: "bar" });
});
});

describe("now cause", () => {
it("should return the current time", () => {
let now = Date.now();
Expand Down

0 comments on commit e70df6a

Please sign in to comment.