Skip to content

Commit

Permalink
fix most tests for test-sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
schuyler1d committed Jan 25, 2020
1 parent c4cbf3c commit 648895c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions __test__/workers/assign-texters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ describe("test texter assignment in dynamic mode", () => {
job_type: "assign_texters"
});
await assignTexters(job);
const result = await r
.knex("campaign_contact")
.where({ campaign_id: campaign.id })
.whereNotNull("assignment_id")
.count();
const assignedTextersCount = result[0]["count"];
expect(assignedTextersCount).toEqual("0");
const assignedTextersCount = await r.getCount(
r
.knex("campaign_contact")
.where({ campaign_id: campaign.id })
.whereNotNull("assignment_id")
);
expect(assignedTextersCount).toEqual(0);
});

it("supports saving null or zero maxContacts", async () => {
Expand Down
3 changes: 2 additions & 1 deletion jest.config.sqlite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ module.exports = require("./jest.config");
module.exports.globals.DB_JSON = JSON.stringify({
client: "sqlite3",
connection: { filename: "./test.sqlite" },
defaultsUnsupported: true
defaultsUnsupported: true,
useNullAsDefault: true
});

0 comments on commit 648895c

Please sign in to comment.