@xtandard/links/testing
Testing utilities — @xtandard/links/testing.
createTestLinks: an in-memory core + redirect handler with a manual-flush ingestor and a memory analytics sink you can inspect.clickRequest: build a realistic redirect request (user agent, geo headers, referrer, language).USER_AGENTS: a few real user agents for tests and demos.
import { … } from "@xtandard/links/testing";Functions
Section titled “Functions”| Name | Summary |
|---|---|
clickRequest |
Build a redirect request with realistic headers. Defaults: macOS Chrome, US. |
createCollectingSink |
Create a CollectingSink. |
createTestLinks |
An in-memory core + redirect handler for tests. defaultDomain defaults to "sho.rt". Background writes are awaited by TestLinks.flush. |
Interfaces
Section titled “Interfaces”| Name | Summary |
|---|---|
ClickRequestOptions |
Options for clickRequest. |
CollectingSink |
A sink that keeps every event in an array (exact reference aggregation). |
TestLinks |
Result of createTestLinks. |
TestLinksOptions |
Options for createTestLinks. |
Variables
Section titled “Variables”| Name | Summary |
|---|---|
USER_AGENTS |
A few real user agents. |