Skip to content

Add (or generate) typescript definitions for testdriver.js and other important files #130

Open
@marcoscaceres

Description

@marcoscaceres

Summary

Resources, such as testdriver.js, contain fantastic documentation and typescript compatible annotation information. It would be great if these were exported to .d.ts file(s) so they could be picked up by code editors.

Details

Because WPTests use absolute paths to script (and other reasons), the extremely useful documentation found in testdriver.js and other files can't be used by code editors, like VS Studio Code.

This means that people writing tests are missing out on all this valuable documentation and type checking information. Exposing such information would also catch test bugs, because it would could allow for TypeScript static checking.

It would also allow for introspection of test objects, to expose methods, signatures, properties, return types, etc.

What would be amazing would be if the testdriver.js annotations were in actual typescript files.

Risks

The typescript files getting out of sync with what's declared in the .js files. However, we could maybe include a warning that those files are automatically generated and shouldn't be touched (that is, if they can be automatically generated... I believe some can).

cc @saschanaz, who knows a lot more about TS than I do 🙇‍♀️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions