2.0.0 • Published 2 years ago

jest-serializer-xlsx-populate v2.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

Serializer for XLSX Workbooks

Turn an xlsx-populate workbook into a pretty snapshot.

The serializer will also look for columns marked as ID or Date and mask them, as these will normally change from test to test.

Usage

First you need to add the snapshot serializer. You have two options:

  1. Expect.addSerializer
const xlsxPopulateSerializer = require('jest-serializer-xlsx-populate');
expect.addSnapshotSerializer(xslxPopulateSerializer);
  1. Jest config

for example in package.json

{
  "name": "my project",
  "jest": {
    "snapshotSerializers": ["jest-serializer-xlsx-populate"]
  }
}

Then you can serialize

const wb = await XlsxPopulate.fromFileAsync('my-file.xlsx');
expect(wb).toMatchSnapshot();

Of course since you're using xlsx populate to create an xlsx file, it will probably be easier to test the Workbook before saving to disk.

1.7.0-alpha.1

2 years ago

1.7.0-alpha.0

2 years ago

2.0.0

2 years ago

1.6.2-alpha.0

2 years ago

1.6.2-alpha.1

2 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago