@lewiswright/vitest-plugin-vis
Version:
Vitest visual testing plugin
12 lines (11 loc) • 402 B
JavaScript
import { isAbsolute } from 'pathe';
export function assertTestPathDefined(context, commandName) {
if (!context.testPath) {
throw new Error(`'commands.${commandName}' requires testPath to be defined`);
}
}
export function assertIsRelativePath(relativeFilePath, propName) {
if (isAbsolute(relativeFilePath)) {
throw new Error(`'${propName}' must be a relative path`);
}
}