Skip to Content
SimulatorsWordSaved document

Simulators

Saved document

office.docx() resolves to the simulator’s document as a .docx in a Buffer. It holds the seed with every edit your add-in has made since, revisions and comments included. That includes edits inside a content control around table rows, which Word’s getOoxml leaves out. Compare it with what a headless OOXML path makes from the same seed, or keep it as the test’s artifact. The simulator serves the same bytes, so a browser test or curl reads them without a harness:

curl -s "$RYSTIC_URL/_rystic/inspect?view=docx" -o redlined.docx
unzip -p redlined.docx word/document.xml | grep -o '<w:ins ' | awk 'END{print NR}'
# -> 3
import { writeFileSync } from 'node:fs';

it('redlines the payment clause', async () => {
  await redlineClause('30 days', '45 days');
  writeFileSync('redlined.docx', await office.docx());
});
  • Same edits, same file. Two runs that make the same edits from the same seed save byte-identical files, because the simulator’s clock never moves by wall time.
  • It is a whole package. The file carries the document, its styles, settings, fonts and theme, and POST /_rystic/seed takes it back as state_document.main.docx.
  • Reading it sends no batch. GET /_rystic/inspect?view=docx adds nothing to the counts office.stats() reports.
Last updated on