Repository navigation
RDE-1.10: javascript-excel's conformance corpus through the public API - #213
Merged
Merged
Conversation
…c API Every corpus workbook is converted to exportWorkbook input and compared with javascript-excel's own file: byte-identical where the API can express the whole file, otherwise byte-identical to the same workbook without the listed features (docs/conformance.md). Also read back with javascript-excel/read, opened with openpyxl in a new Conformance CI job, and the builder and table golden cases go through the hooks and components. The corpus is copied from javascript-excel's tag for the installed version (npm run conformance:sync, checked in CI).
An upgrade that leaves the corpus unchanged then needs no new copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runs javascript-excel's conformance corpus (its JSE-9 files
01-values…19-buildersand99-kitchen-sink) through react-data-export's public API and compares the result with javascript-excel's own output. The newdocs/conformance.mdhas the per-file results.How
scripts/sync-jse-corpus.mjscopiestest/conformance/corpus.tsandtest/interop/xlsx_dump.pyfrom the javascript-excel git tag that matches the installed version (currentlyv2.0.0-alpha.3; the corpus hasn't changed through alpha.7). The only edit is that the import of../../src/indexbecomesjavascript-excel. You refresh it withnpm run conformance:sync. CI runs it with--check, so the copy can't drift from the engine under test. The copied files don't record the version, so an engine upgrade that leaves the corpus unchanged doesn't need a new copy.test/conformance/to-spec.ts). Each corpus workbook becomes anexportWorkbookspec:freezeHeader;header: false,indexcolumns,fromDatasetsoffsets).style/headerStyle), right-to-left, the active sheet, document properties and write options all carry over.conformance.test.ts):expressible.ts, each with a reason;javascript-excel/read: no warnings, and the same sheets, values, merges and names;exportDatasetgives the same bytes asexportWorkbook, andformat: 'csv'matchestoCsvBlob.golden.test.tsx):19-buildersDataset and Stacked sheets, built from the corpus's dataset input throughexportWorkbook,exportDataset,useExcelExportand<ExcelExport>;exportTable,useTableExportand<ExportTableButton>.toUint8Array. A guard test fails if the corpus's builder input changes.Results
Byte-identical as-is:
05-formulas,11-number-formats-locale,12-colours,18-limits(including the cell at XFD1048576 and the 64,000 cell formats).Byte-identical without the listed features: every other file.
Not expressible through the React API:
width: 'auto''s bestFit flag;The reasons are in
docs/conformance.md.19-buildersis listed only because it's converted from the finished sheet; built from its dataset input, it's byte-identical.CI
npm test. They skip openpyxl when it isn't installed.openpyxl==3.1.5into a virtualenv (the same version javascript-excel's CI uses) and runstest/conformancewith openpyxl required. It isn't a required check; whether to make it one is your call.npm run conformance:syncin the same PR, or this job fails. This is noted in CONTRIBUTING.md.Dependencies
No new runtime or dev dependencies. openpyxl is a Python package, installed in the CI job's virtualenv only, as in javascript-excel.
No changeset: the change is tests, CI and docs only.
Local runs (Node 26): with javascript-excel 2.0.0-alpha.7 installed in place of alpha.3, the full suite passes, openpyxl included, and
--checkpasses against thev2.0.0-alpha.7tag.npm testpasses on React 19 and React 17 (viascripts/use-react.mjs 17).npm run typecheckanddocs:checkpass.test/conformancewith openpyxl passes 112 tests, with 1 skipped: openpyxl on the heavy18-limits, which javascript-excel skips as well.