diff --git a/server/job/test/job-totals.test.js b/server/job/test/job-totals.test.js index 059b0bb1e..04a915b6b 100644 --- a/server/job/test/job-totals.test.js +++ b/server/job/test/job-totals.test.js @@ -2,7 +2,8 @@ import fs from "fs"; import path from "path"; import { describe, it, expect } from "vitest"; import { TotalsServerSide as TotalsServerSideCA } from "../job-totals"; // Canadian version (imex) -import { TotalsServerSide as TotalsServerSideUS } from "../job-totals-USA"; // US version (rome) +import { TotalsServerSide as TotalsServerSideUS } from "../job-totals-USA"; +import { isFunction } from "lodash"; // US version (rome) /** * This function is used to replace the values in the object with their toObject() representation. @@ -11,7 +12,7 @@ import { TotalsServerSide as TotalsServerSideUS } from "../job-totals-USA"; // U * @returns {*} */ const dineroReplacer = (key, value) => { - if (value && typeof value === "object" && typeof value.toObject === "function") { + if (isFunction(value)) { return value.toObject(); } return value;