Skip to main content

Testing

Unit tests live beside services and use Jest with local mocks for the data layer (__mocks__/access-control-client.ts).

Running Tests

pnpm nx run access-control:test:unit --runInBand

Test Locations

See examples under libs/access-control/src/**/__tests__/unit.

Patterns

  • Mock @digiwedge/access-control-client classes in unit tests
  • Prefer verifying business rules and audit calls (dataBefore/dataAfter snapshots)