CODING REVIEW PRACTICE
Synthetic educational code. No real repository, credentials or customer data.
Requires Node.js 22 or newer. No npm install or network required.

Files:
pagination.mjs - intentionally broken original.
pagination.test.mjs - independent acceptance tests; do not edit.
pagination-fixed.mjs - checked reference, supplied after the exercise.

Contract:
total must be a non-negative safe integer; pageSize a positive safe integer.
Other values must throw RangeError. Empty total returns 0; otherwise round up.
Keep export totalPages(total, pageSize).

Run in this directory:
node --test pagination.test.mjs

The original is expected to fail: 2 pass, 11 fail.
Review an AI suggestion before editing pagination.mjs.
Run the same tests again; the checked reference passes 13/13.
Do not use the supplied reference as evidence that an untested AI reply passed.

No deploy, commit, push, package install or external side effects are needed.
