Refer to the requirements listed on the Installation page.
tests directory structure below:
.└── tests/ ├── test.one.spec.ts ├── test.two.spec.ts ├── test.three.spec.ts └── tsconfig.json
Ensure you already have
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:
suites: - name: "basic test" testMatch: 'tests/*.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 transpiled tests:
If you would like to see sample tests and configuration files for particular frameworks, you can clone one of our demo repositories for use as a template: