Refactor/unit test rewrite#4584
Merged
Merged
Conversation
7f389f9 to
ebc9727
Compare
5df2e3d to
f150765
Compare
…history-query, ip-filter, north, oianalytics) to node:test
…n-mode, south, transformer, user) to node:test
…ter, log, scan-mode, user, utils-*) to node:test
…ce specs to node:test
…empty-fn, unused-vars)
…alidator, transformer, north-connector)
…idator, history-query, south-connector)
…production code Replace pino.Logger with a narrow ILogger interface across all production files and mock classes. LoggerMock now implements ILogger, eliminating ~200 as-unknown-as-pino.Logger casts and the asLogger() escape-hatch helper from test-utils.
…and spec Extract toSouthConnectorItemDTO, toSouthItemGroupDTO, toHistoryQueryItemDTO, and toScanModeDTO into lightweight utility files that do not transitively import south-connector-factory, eliminating the ODBC crash on spec load. Update oianalytics-command.service.ts and the spec to import from these files instead of south.service / history-query.service. Fix incorrect cancel count assertion in the "should check retrieved command" test.
… migration - Add ILogger interface to remove pino.Logger dependency in mocks - Add narrow interfaces in service files to decouple from concrete class imports - Fix mock classes to extend real classes for type safety - Fix ODBC loading by using import type for DataStreamEngine in service files - Move southManifestList/northManifestList imports to dedicated manifest files - Fix history-query.service.ts setter propagation crash in HistoryQueryMock - Fix metrics getter shape to match engine expectations
…alue API after rebase
…ryable status codes
2c30c48 to
c731b47
Compare
…nt production strings
Move nodeOptions and testRunner sections from the standalone node.coverage.config.json into package.json, pointing --experimental-config-file at package.json itself.
1ded4fc to
f452564
Compare
burgerni10
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed:
node:test(Node.js built-in test runner), removingjest,@types/jest, andjest-environment-jsdomfromdevDependenciesjest.fn()/expect()/jest.mock()withmock.fn()/assert.*/ a require-cache swap pattern (mockModule + reloadModule) that works with ESM/CommonJS interop undertsxtsxas the test transformer; updated all npm test scripts accordinglycreateMockServices()factory totest-utils— centralizes mock service construction for all 13 controller specs, eliminating repeatedObject.assign({} as Services, partial)workaroundsauth,ip-filter,services,sse,web-client) — these were completely uncovered beforeauth.middleware.ts(a duplicateif (req.url === '/api/users/current-user')block that could never execute)--test-coverage-excludeflags for files with no testable logic: entry point, auto-generated routes, DB migrations, connector manifests, type-only model files, and build scripts