/** * App startup require-graph smoke test (DC-020 regression guard) * * WHY THIS EXISTS: * The `refactor(desloppify)` commit deleted `license-keygen.js` thinking it was * stale dev-root noise. It is actually required by `src/managers/license-manager.js` * (`require('./license-keygen')`). The deletion put the production `dashcaddy-api` * container in a crash-restart loop (MODULE_NOT_FOUND from /app/src/app.js). The * full Jest suite (1036 tests) passed anyway because NO test ever executed * `require()` on the real app module — every "app" test read src/app.js as a * string or rebuilt a minimal Express app with copied handlers. * * This test closes that gap: it executes the real production require graph and * asserts it resolves without throwing. Any future deletion of a required module, * or any broken relative require, will fail here instead of crashing the container * on the next deploy. */ const path = require('path'); describe('app startup require-graph smoke', () => { it('src/app.js and its entire require graph load without throwing', () => { expect(() => require(path.join(__dirname, '..', 'src', 'app'))).not.toThrow(); }); it('createApp is exported as a function', () => { const mod = require(path.join(__dirname, '..', 'src', 'app')); expect(typeof mod.createApp).toBe('function'); }); });