Add Jest unit test infrastructure and initial test suite

Sets up Jest + ts-jest for the backend and adds 47 tests across 5
suites covering crypto utilities, OUI vendor lookup, auth middleware,
AlertService dispatch/cooldown logic, and DeviceCollector uptime parsing.
This commit is contained in:
2GT-Rich
2026-04-19 10:21:14 -07:00
parent 6cb2e6844c
commit 5d96503832
8 changed files with 4108 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.test.ts'],
collectCoverageFrom: [
'src/**/*.ts',
'!src/db/migrations/**',
'!src/index.ts',
],
coverageReporters: ['text', 'lcov'],
};