Vanilla k6 over K6chaijs

Hi @Tom & @mstoykov

I checked K6chaijs repo

It looks similar to the vanilla k6. Instead of groups and checks It uses chai assertion. Can someone explain what are the advantages or features I can get it over vanilla k6 with the help of K6chaijs.

Hey Gerard,

please see the documentation for k6chajs and also the explanation about why this library has better error handling than the default k6.

Here’s a short excerpt from the documentation:

k6chajs Assertion Library is an assertion library that is paired with k6 to provide a more developer-friendly BDD and TDD assertion style. It’s a more powerful alternative to the k6-native check() and group().

This library is recommended for any type of testing, but especially for:

  • Functional testing, where many asserts are needed.
  • Stress testing, where the System Under Test is failing and the test code needs to stay robust.
  • Load testing, when the test should abort as soon as the first failure occurs.
  • Unit testing of JavaScript code, which is not necessarily connected with load.
  • JavaScript Developers, who are already familiar with Chai, Jest or Jasmine.
2 Likes