Skip to content

mason26611/Formbar-Tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formbar Backend Endpoint Tests

This repo runs end-to-end smoke coverage against a clean, temporary Formbar install. It is intentionally separate from the backend and frontend repos.

The runner copies the backend and frontend repositories from paths in .env, excludes existing databases, keys, logs, node_modules, nested git state, and build output, then installs dependencies, initializes a fresh database, starts the backend and frontend, and runs coverage suites.

Environment Setup

Copy-Item .env.example .env
# edit .env with your local backend and frontend paths

Required values:

  • FORMBAR_BACKEND_REPO: absolute path to the Formbar.js backend repository.
  • FORMBAR_CLIENT_REPO: absolute path to the Formbar.ts-client frontend repository.

First Run

npm install
npm test

Useful Environment Variables

  • FORMBAR_BACKEND_REPO: backend repo path. Required.
  • FORMBAR_CLIENT_REPO: frontend repo path. Required.
  • WORK_DIR: temporary workspace root. Defaults to .tmp.
  • SKIP_INSTALL=true: do not run npm install in copied repos.
  • SKIP_FRONTEND_START=true: copy/install the frontend but do not start Vite.
  • KEEP_WORKDIR=true: keep the temporary copied repos after the run.
  • SETUP_TIMEOUT_MS=240000: timeout for install commands.
  • SUITE_TIMEOUT_MS=180000: timeout per suite.
  • NO_COLOR=1: disable ANSI color output.

What Is Covered

  • Every Express route discovered under api/v1/controllers, excluding tests and the controller template.
  • Every client-to-server socket event discovered under sockets, including events registered with onSocketEvent and direct socket.on handlers.
  • A guard that fails when the backend adds a new HTTP endpoint or socket event that the suite does not exercise.

The checks are smoke-style integration tests: each discovered endpoint/event is invoked against a fresh database and seeded users/classes. A server error, wrong HTTP method, missing route, socket error response, or inventory mismatch fails the run.

About

This is a testing project for every HTTP and socket endpoint in Formbar.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors