Problem
After the refactor(analytics): move from module to lib (#3325) commit, the analytics test files in modules/analytics/tests/ still mock the old module path ../../analytics/services/analytics.service.js instead of ../../../lib/services/analytics.js.
Failing tests:
analytics.service.resilience.unit.tests.js — init() is async but called without await, client never set, so error propagation tests fail (methods no-op due to if (!client) return)
analytics.identify.unit.tests.js — mocks ../../analytics/services/analytics.service.js but auth.controller.js now imports from ../../../lib/services/analytics.js, so the mock is never hit
Affected file(s)
modules/analytics/tests/analytics.service.resilience.unit.tests.js
modules/analytics/tests/analytics.identify.unit.tests.js
Steps to reproduce
- Clone Node stack at
devkit-node/master (c01d0a9)
npm run test:coverage
- Both analytics test files fail (10 test failures total)
Problem
After the
refactor(analytics): move from module to lib (#3325)commit, the analytics test files inmodules/analytics/tests/still mock the old module path../../analytics/services/analytics.service.jsinstead of../../../lib/services/analytics.js.Failing tests:
analytics.service.resilience.unit.tests.js—init()is async but called withoutawait,clientnever set, so error propagation tests fail (methods no-op due toif (!client) return)analytics.identify.unit.tests.js— mocks../../analytics/services/analytics.service.jsbutauth.controller.jsnow imports from../../../lib/services/analytics.js, so the mock is never hitAffected file(s)
modules/analytics/tests/analytics.service.resilience.unit.tests.jsmodules/analytics/tests/analytics.identify.unit.tests.jsSteps to reproduce
devkit-node/master(c01d0a9)npm run test:coverage