Pre-check
Describe the improvement
I'd like to report
Description of the improvement / report
I created a repository where I tried to reproduce the problems I found, when setting up visual testing: https://github.com/htho/wdio-repro-visual-service
TypeScript can't tell, what type to expect for the configuration object for visual.
This could be improved, so we have IntelliSense when editing the object.
https://github.com/htho/wdio-repro-visual-service/blob/main/wdio-default.conf.ts#L11-L20
services: [
[
"visual",
{
// no automatic type information
// therefore the `satisfies VisualServiceOptions` below.
// TODO: REPORT
} satisfies VisualServiceOptions,
],
],
To fix this I added satisfies VisualServiceOptions.
I gather the type like this, because VisualServiceOptions is not exported.
https://github.com/htho/wdio-repro-visual-service/blob/main/wdio-default.conf.ts#L2-L7
import type { ClassOptions } from 'webdriver-image-comparison';
// should be exported
// TODO: REPORT
// https://github.com/webdriverio/visual-testing/blob/f4d9e654a746d09e9ca2567ffe69200c161cc14b/packages/visual-service/src/types.ts#L62
type VisualServiceOptions = ClassOptions;
To improve Documentation/DX, VisualServiceOptions should be available for import.
Also there should be type information, about the config object for visual
Pre-check
Describe the improvement
I'd like to report
Description of the improvement / report
I created a repository where I tried to reproduce the problems I found, when setting up visual testing: https://github.com/htho/wdio-repro-visual-service
TypeScript can't tell, what type to expect for the configuration object for
visual.This could be improved, so we have IntelliSense when editing the object.
https://github.com/htho/wdio-repro-visual-service/blob/main/wdio-default.conf.ts#L11-L20
To fix this I added
satisfies VisualServiceOptions.I gather the type like this, because
VisualServiceOptionsis not exported.https://github.com/htho/wdio-repro-visual-service/blob/main/wdio-default.conf.ts#L2-L7
To improve Documentation/DX,
VisualServiceOptionsshould be available for import.Also there should be type information, about the config object for
visual