grafana / k6x

Run k6 with extensions
GNU Affero General Public License v3.0
13 stars 3 forks source link

Add dependencies on the command line #10

Closed szkiba closed 1 year ago

szkiba commented 1 year ago

Feature Description

In some cases, it may be useful to add dependencies on the command line without modifying the test script.

Suggested Solution (optional)

Additional dependencies and version constraints can be specified on the command line with the --with flag.

--with dependency you can specify additional dependencies and version constraints, the form of the dependency is the same as that used in the "use k6 with" pragma (practically the same as the string after the use k6 with)

k6x run --with k6/x/mock script.js

The example above adds the xk6-mock extension to the list of dependencies.

Already existing or connected issues / PRs (optional)

This feature is a simplified version of #8, making it obsolete.