Test script development workflow

Hi,

Since k6 is neither compatible with NodeJS nor runs on it, you cannot run this code outside the k6 environment. There are two main reasons for this:

  1. The “k6/*” is a k6 internal API, which will only work when you run the script with k6.
  2. k6 uses Goja as JS engine, and only ES5.1+ syntax is compatible with it.

You can run your test with k6 as is, in order to be able to debug them. It will perfectly show console output, when run locally. Also, you don’t need to run it with thousands of VUs to figure this out, just go with 1 VU (which is the default).

For starting to work with k6, I highly recommend you to have a look at the documentation: Running k6

1 Like