How to use JS (or even TS) test-script file instead of Yaml #2566
Replies: 3 comments 10 replies
-
Hello @HugoImaios 👋, To use Typescript support, you still write your basic skeleton of a script in YAML. However, in the YAML file you can point to a Typescript processor which contains exported functions, so your actual logic can be written in Typescript or Javascript. How to load the several different types of processors (.js, .mjs or .ts) is explained here. From there, you would write functions you can then use in your scenarios.
As for your other questions:
The name of that package is probably misleading, and we will likely change it soon. At the moment,
Those types are not published by the Artillery team, but by an open source contributor. It is mostly quite good, though! |
Beta Was this translation helpful? Give feedback.
-
hello @bernardobridge ! |
Beta Was this translation helpful? Give feedback.
-
Just wanted to throw my 2¢ in here @bernardobridge. I recently discovered Artillery and was super interested in it all up until I found out that test cases must be written in yaml. No type safety, no code reuse, white-space as syntax... that's not something they my team can rely on 🙃 (We have to use yaml already for GitHub Actions and that's bad enough as it is.) |
Beta Was this translation helpful? Give feedback.
-
Through the documentation, we can find this :
Which sounds great 😍 !
After exploring a bit the github packages, we can even find this one which is published on npm as
@artilleryio/types
and which seems to provides type definitions for artillery config, scenarios, etc. 🎉 (subsidiary question : why is there a DT package (@types/artillery) then ?)But : how can we run this using artillery ?
artillery run
seems to be locked onto yaml files, causingYAMLException: end of the stream or a document separator is expected
Beta Was this translation helpful? Give feedback.
All reactions