function addQUnitFilter
addQUnitFilter(
url: string,
filter: string | undefined
): string

The URL to open, with the run's own filter applied as QUnit's.

QUnit reads filter and moduleId off the query string, which is how its own HTML reporter narrows a run — so -t adds becomes the page's ?filter=adds and everything the URL already carried is kept. A URL that names its own filter keeps it: it was typed, and this was not.

import { addQUnitFilter } from './remote-page.ts';

addQUnitFilter('https://x/test/', 'adds'); // 'https://x/test/?filter=adds'
addQUnitFilter('https://x/test/?moduleId=6e15ed5f', 'adds');
// 'https://x/test/?moduleId=6e15ed5f&filter=adds'
addQUnitFilter('https://x/test/?filter=mine', 'adds'); // 'https://x/test/?filter=mine'
addQUnitFilter('https://x/test/', undefined); // 'https://x/test/'

Parameters

url: string
filter: string | undefined

Return Type

string

Usage

import { addQUnitFilter } from "lib/setup/remote-page.ts";