moxie/testing-and-quality

Testing

Command

yarn test

Tests live in tests/ (Jest configuration per repo defaults).

What to test

Layer Suggestion
Pure helpers compute functions, URL builders, parsers — fast, deterministic
Querystring mappers Edge cases: empty csv, invalid numbers, defaults
Regression bugs Add a test when fixing a subtle mapping or routing bug

What is harder to test

  • Full Lambda + API Gateway integration — usually exercised via deployed dev + automated smoke tests elsewhere.
  • Heavy Spark fixtures — prefer recorded snapshots or minimal JSON fixtures checked into tests/ when allowed.

CI

  • Pull requests should stay green on yarn test before merge (exact CI job names depend on org setup — align with develop branch protections).