Skip to content

Testing

No tests exist.

  • package.json has no test script (no scripts.test).
  • No test framework (Jest, Vitest, Mocha) in dependencies or devDependencies.
  • No __tests__/, test/, spec/, e2e/ directories.

What the mock/ directory is (and isn't)

The mock/ directory is sometimes mistaken for test fixtures. It is not — those files are part of the runtime branch (isLocal === true mode in routes/index.js). They are loaded by require() from the running server, not by a test runner.

There is no harness that hits the standalone server's endpoints and asserts on the response.

Manual verification

What is currently practical:

  1. NODE_ENV=development node server.js (in this repo).
  2. curl http://localhost:6001/dashboard/getAccountInsights/2026-01-01/2026-01-31/[1,3,4] — returns mock data.
  3. Eyeball the response.

What a minimal test suite would look like

For a 10-endpoint service, the bar is low. A first pass:

  • Smoke: per endpoint, an integration test that boots the server in mock mode and asserts a 200 response with the expected shape.
  • Shape: assert that mock responses match the production response shape (currently nothing enforces this — the mocks can silently drift).
  • Param validation: send malformed :pId (e.g., "foo" instead of a JSON array) and assert the handler doesn't crash.

A supertest + vitest setup with ~50 lines of package.json additions would give all the above. Not a current ask, but worth noting as a low-effort improvement.

Coverage in the broader platform

The platform as a whole has no test suite — someli-api, someli-platform, designer-api, Someli-Designer, Someli-admin-api all have "test": "echo \"Error: no test specified\" && exit 1" placeholders. admin_console_R has ESLint configured but no unit tests. This repo follows the same posture.