Ultimate

X_TEST_POLICY_EXPECTED

Means

a matcher expected a policy and got something else

Typical cause

toDenyPolicy answered pass:false for a receiver that is not a policy, so .not.toDenyPolicy PASSED on undefined or a typo. The receiver is checked synchronously and refused with this code, under .not too

Fix

expect(post.policy).toDenyPolicy(ctx) — pass the policy object (@ultimat3/policy's, with run() or evaluate()), never the action or its result

Listed under Testing

This page as markdown