Skip to content

Commit

Permalink
fix(#172): fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
witash committed Jan 30, 2025
1 parent 5c872f7 commit 8a6feb4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions couch2pg/tests/unit/importer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('importer', () => {

expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args).to.deep.equal([[
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4),($5, $6, $7, $8),($9, $10, $11, $12) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5),($6, $7, $8, $9, $10),($11, $12, $13, $14, $15) ' + ON_CONFLICT_STMT,
[
now.toISOString(),
'doc1',
Expand Down Expand Up @@ -239,7 +239,7 @@ describe('importer', () => {
expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).callCount).to.equal(3);
expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args[0]).to.deep.equal([
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4),($5, $6, $7, $8),($9, $10, $11, $12) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5),($6, $7, $8, $9, $10),($11, $12, $13, $14, $15) ' + ON_CONFLICT_STMT,
[
now.toISOString(),
iterationOne.docs[0].id,
Expand All @@ -263,7 +263,7 @@ describe('importer', () => {

expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args[1]).to.deep.equal([
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4),($5, $6, $7, $8),($9, $10, $11, $12) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5),($6, $7, $8, $9, $10),($11, $12, $13, $14, $15) ' + ON_CONFLICT_STMT,
[
now.toISOString(),
iterationTwo.docs[0].id,
Expand All @@ -287,7 +287,7 @@ describe('importer', () => {

expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args[2]).to.deep.equal([
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4),($5, $6, $7, $8),($9, $10, $11, $12) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5),($6, $7, $8, $9, $10),($11, $12, $13, $14, $15) ' + ON_CONFLICT_STMT,
[
now.toISOString(),
iterationThree.docs[0].id,
Expand Down Expand Up @@ -329,7 +329,7 @@ describe('importer', () => {

expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args).to.deep.equal([[
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5) ' + ON_CONFLICT_STMT,
[
new Date().toISOString(),
'change',
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('importer', () => {

expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args).to.deep.equal([[
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5) ' + ON_CONFLICT_STMT,
[
new Date().toISOString(),
'change',
Expand Down Expand Up @@ -408,7 +408,7 @@ describe('importer', () => {

expect(pgClient.query.withArgs(sinon.match(insertDocsMatch())).args).to.deep.equal([[
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4),($5, $6, $7, $8),($9, $10, $11, $12) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5),($6, $7, $8, $9, $10),($11, $12, $13, $14, $15) ' + ON_CONFLICT_STMT,
[
now.toISOString(),
'doc2',
Expand Down Expand Up @@ -584,7 +584,7 @@ describe('importer', () => {

const queryArgs = [
'INSERT INTO v1.whatever (saved_timestamp, _id, _deleted, source, doc) VALUES ' +
'($1, $2, $3, $4),($5, $6, $7, $8),($9, $10, $11, $12) ' + ON_CONFLICT_STMT,
'($1, $2, $3, $4, $5),($6, $7, $8, $9, $10),($11, $12, $13, $14, $15) ' + ON_CONFLICT_STMT,
[
now.toISOString(),
'doc1',
Expand Down

0 comments on commit 8a6feb4

Please sign in to comment.