Refer to the requirements listed on the Installation page.
tests directory structure below:
Except for the TestCafe image, these
Ensure you already have
typescriptinstalled:npm install -g typescript
tsconfig.jsonto ensure you've set the
Run the TypeScript compiler like so:tsc --project ./tests/tsconfig.json
Below is a default output example:└── tests/├── test.one.spec.ts├── test.one.spec.js├── test.two.spec.ts├── test.two.spec.js├── test.three.spec.ts├── test.three.spec.js└── tsconfig.json
WARNING: the TypeScript compiler will behave in a non-deterministic manner if the
tsconfig.jsonis poorly configured.
For more information on how to properly configure
tsconfig.jsonplease visit the documentation.
Next, edit the
.sauce/config.ymlin order to ignore the
.tsfiles and instead place the
.jsfiles inside the Testrunner Toolkit container:files:- tests/suites:- name: "basic test"match: ".*.(spec|test).js"
saucectlwill pickup any
.jsfiles located in the designated directory, however with the
suitesfield you can set more granular control with regular expressions.
saucectlto execute your TypeScript tests:saucectl run -c .sauce/config.yml
For further information, please refer to the working example of this TypeScript demonstration in the Sauce Labs Puppeteer Runner repository.