Skip to content

For CI/CD and DevOps

QBO test data as a build step

Same seed, same data, every run. Use fixtures for fast unit tests and a real QuickBooks Online (QBO) sandbox for integration tests.

1. Fixtures, no QBO needed

Generate a pinned dataset in CI and assert against it. Pin the dates as well as the seed so the output doesn't move with the calendar.

npx easytestdata generate --template saas --scenario rapid-growth --seed 42 \
  --start-date 2025-09-01 --end-date 2026-08-31 \
  --format json --output fixtures/qbo-plan.json

That file always contains 1,080 invoices, the first one EZTD-INV-0001 for Nguyen Media at $10,242.14, and $2,000,000.00 of revenue in total.

2. Load, test, purge against a sandbox

With the CLI, authorize the sandbox once on your machine (npx easytestdata auth), then give the runner the values it saved to .easytestdata.json as secrets. Treat them like passwords: they include an OAuth refresh token. Pin the CLI version and the start date so every run loads the same books.

# .github/workflows/qbo-integration.yml (excerpt)
env:
  QBO_CLIENT_ID: ${{ secrets.QBO_CLIENT_ID }}
  QBO_CLIENT_SECRET: ${{ secrets.QBO_CLIENT_SECRET }}
  QBO_REFRESH_TOKEN: ${{ secrets.QBO_REFRESH_TOKEN }}
  QBO_REALM_ID: ${{ secrets.QBO_REALM_ID }}

steps:
  - name: Load a deterministic year of books
    run: npx --yes easytestdata@0.1.0 load --template saas --scenario rapid-growth --seed 42 --start-date 2025-09-01 --clear-first

  - name: Run your integration tests
    run: npm test

  - name: Remove generated data
    if: always()
    run: npx --yes easytestdata@0.1.0 purge --mode generated -y

-y skips the confirmation prompt; without it the CLI refuses to purge in a non-interactive shell. Intuit rotates refresh tokens, so the full workflow in the repository also writes the rotated token back to your secret.

Deterministic, repeatable, scriptable.

or use EasyTestData Cloud for free