Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 805 Bytes

typescript.md

File metadata and controls

42 lines (32 loc) · 805 Bytes

Testplane × Typescript

To write Testplane tests on typescript, you would need to install ts-node:

npm i -D ts-node

And include Testplane types in your tsconfig.json file:

// tsconfig.json
{
    // other tsconfig options
    "compilerOptions": {
        // other compiler options
        "types": [
            // other types
            "testplane",
        ]
    }
}

Now you will be able to write Testplane tests using typescript.

testplane.ctx typings

If you want to extend testplane.ctx typings, you could use module augmentation:

import type { TestplaneCtx } from "testplane";

declare module "testplane" {
    interface TestplaneCtx {
        someVariable: string;
    }
}

Now testplane.ctx will have someVariable typings