xlsx-compare
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

XLSX-COMPARE

Efficient way to compare excel files in the scope of content. Spot where the excel file differs to the cell.

Response

On Success

{ success: true, differences: {} }

On fail

{
  success: false,
  differences: {
    cells: {
      B2: {
        expected: 39200,
        received: "Different"
      },
      B5: {
        expected: 28900,
        received: "Values"
      },
      B8: {
        expected: 20200,
        received: "Are"
      },
      B11: {
        expected: 7200,
        received: "Here"
      }
    },
    // optionally if file is missing or have some additional cells
    additionalCells: ["D5"],
    missingCells: ["B6"]
  }
}

How to use it.

Within node

const { xlsxCompare } = require("../index");

xlsxCompare("path/to/fixture.xlsx", "path/to/file.xlsx");

Within cypress

  • plugins file / cypress.config.js
const { xlsxCompare } = require("../index");

...
on("task", {
    ...
    "xlsx:compare"({fixture, file}) {
        return compareXLSX(fixture, file)
    }
})
...
  • suite file
cy.task('xlsx:compare', {fixture, file}).then(...)

Readme

Keywords

Package Sidebar

Install

npm i xlsx-compare

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

8.07 kB

Total Files

7

Last publish

Collaborators

  • kurekszymon