Skip to content

How to use testing APIs ? #108

@Mikastark

Description

@Mikastark

Hi, thanks for the effort you've put into maintaining this package—it's much appreciated!

I've been trying to use provideMatomoTesting in my unit tests but found it difficult to understand how the testing APIs are designed to work. Specifically, I'm unclear about its behavior and capabilities:

  • Does it maintain any state?
  • Is there a way to list or retrieve tracking events?
  • Is it simply a No-op tracker provider, or does it support more functionality?

For example, the MatomoTestingTracker JSDoc states:

All getter methods will immediately resolve to an empty value. This can be customized by setting a custom Matomo instance with setMatomoInstance().

However, setMatomoInstance is marked as deprecated and replaced by MATOMO_TESTING_INSTANCE, which isn’t exported by the package—so it's inaccessible. Is this intentional?

In short, could you consider adding a documentation page specifically about testing? It would be incredibly helpful to better understand how to use the testing APIs effectively.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions