Skip to content

fix(analytics): stale test paths after refactor to lib/services #3330

Description

@PierreBrisorgueil

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.jsinit() 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

  1. Clone Node stack at devkit-node/master (c01d0a9)
  2. npm run test:coverage
  3. Both analytics test files fail (10 test failures total)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixA bug fix

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions