MCPcopy Create free account
hub / github.com/tester-army/e2e / initScriptLabel

Function initScriptLabel

packages/web/src/init-scripts.ts:78–81  ·  view source on GitHub ↗
(script: unknown)

Source from the content-addressed store, hash-verified

76
77/** The step label of a script: the file a `path` names, else its kind, never its source. */
78export function initScriptLabel(script: unknown): string {
79 if (typeof script === 'object' && script !== null && 'path' in script) return String(script.path);
80 return typeof script === 'function' ? 'function' : 'source';
81}
82
83/** Throws what `fail` makes of the problem unless `script` is one init script. */
84function assertInitScript(script: unknown, fail: (problem: string) => Error): asserts script is WebInitScript {

Callers 1

createBrowserFixtureFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected