Testcafe: type definition for runner Video options is missing

Created on 6 Jun 2019  路  3Comments  路  Source: DevExpress/testcafe

What is the Current behavior?

using vscode or webstorm we cant see the video options in the auto complete pop up. going through index.d.ts you would see that the video options typing is not there too.

What is the Expected behavior?

to be able to autocomplete video options based on the type definition file.

screenshot

image

Your Environment details:

  • testcafe version: 1.2.0
  • node.js version: 12
  • platform and version: Windows 10
TypeScript definitions HELP WANTED Auto-locked enhancement

Most helpful comment

Ran into the same issue so for other readers, the temporary workaround of using module augmentation will work:

declare global {
  interface VideoOptions {
    singleFile?: boolean;
    failedOnly?: boolean;
    pathPattern?: string;
  }

  interface Runner {
    video(path: string, options?: VideoOptions, encodingOptions?: unknown): this;
  }
}

I didn't know what type to properly assign to encodingOptions as it supports "all of ffmpeg options" so I left it as unknown.


Edit: modified the sample above so VSCode IntelliSense sees video as a method rather than a property. They achieve the same in typings, but this is more consistent.

All 3 comments

Ran into the same issue so for other readers, the temporary workaround of using module augmentation will work:

declare global {
  interface VideoOptions {
    singleFile?: boolean;
    failedOnly?: boolean;
    pathPattern?: string;
  }

  interface Runner {
    video(path: string, options?: VideoOptions, encodingOptions?: unknown): this;
  }
}

I didn't know what type to properly assign to encodingOptions as it supports "all of ffmpeg options" so I left it as unknown.


Edit: modified the sample above so VSCode IntelliSense sees video as a method rather than a property. They achieve the same in typings, but this is more consistent.

Closed by #4636.

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chebum picture chebum  路  3Comments

Lukas-Kullmann picture Lukas-Kullmann  路  3Comments

AndreyBelym picture AndreyBelym  路  3Comments

madroneropaulo picture madroneropaulo  路  3Comments

AndreyBelym picture AndreyBelym  路  3Comments