See https://github.com/grafana/k6-template-typescript
Install dependencies
yarn install
To run a test written in TypeScript, we first have to transpile the TypeScript code into JavaScript and bundle the project
yarn start
This command creates the final test files to the ./dist
folder.
Once that is done, we can run our script the same way we usually do, for instance:
k6 run dist/${YOUR_TEST}-test.js