perf: enforce journey budgets and reference traces
This commit is contained in:
@@ -97,6 +97,16 @@ export const wrongTokenFaultUrl = (origin: string, fault: PortfolioFaultId): str
|
||||
fault,
|
||||
);
|
||||
|
||||
export const authorizedPerformanceUrl = (origin: string, tier: 'high' | 'low'): string => {
|
||||
const token = process.env.PORTFOLIO_TEST_TOKEN;
|
||||
if (token === undefined) throw new Error('The per-run portfolio test token is unavailable.');
|
||||
const url = new URL(origin);
|
||||
url.searchParams.set('__portfolio_performance', 'drive-trace.v1');
|
||||
url.searchParams.set('__portfolio_test_token', token);
|
||||
url.searchParams.set('__portfolio_tier', tier);
|
||||
return url.href;
|
||||
};
|
||||
|
||||
export interface BrowserErrorCollector {
|
||||
readonly pageErrors: string[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user