Skip to content

Commit

Permalink
do not run assert if nothing has been arranged in mysql (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Ab <[email protected]>
  • Loading branch information
fantazista and abdala authored Nov 26, 2024
1 parent 91e06d0 commit 6eb4d40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dtc-mysql-plugin/src/mysql-mock-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const arrange = async (args: unknown) => {
}

export const assert = () => {
if (!arrangeMysql) {
return
}

const parser = new nodeSqlParser.Parser()

for (const [index, arrange] of arrangeMysql.entries()) {
Expand Down Expand Up @@ -70,7 +74,7 @@ export const assert = () => {

nodeAssert.equal(executions[index].mock.calls.length, arrange.length)
}

arrangeMysql = []
executions = []
}

0 comments on commit 6eb4d40

Please sign in to comment.