(lhs, rhs, fields, comparator)
| 30 | const client = new MongoClient(uri); |
| 31 | |
| 32 | function diff(lhs, rhs, fields, comparator) { |
| 33 | return fields.reduce((diff, field) => { |
| 34 | if ((lhs[field] == null || rhs[field] == null) && field !== class="st">'error') { |
| 35 | return diff; |
| 36 | } |
| 37 | |
| 38 | if (!comparator(lhs[field], rhs[field])) { |
| 39 | diff.push( |
| 40 | ` ${field}: ${chalk.green(`${util.inspect(lhs[field])}`)} => ${chalk.green( |
| 41 | `${util.inspect(rhs[field])}` |
| 42 | )}` |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | return diff; |
| 47 | }, []); |
| 48 | } |
| 49 | |
| 50 | function serverDescriptionDiff(lhs, rhs) { |
| 51 | const objectIdFields = [class="st">'electionId']; |
no test coverage detected