K6 Build chaijs with OpenApi validator

Hi! Im trying to build mi own version o k6ChaiJs with one of these open api validators

But it was imposible to make it run correctly the build.
I have followed the defined steps in this post but it didnt worked for me.
Im almost sure there is a problem with index.ts file but i couldnt figure out what should i put there for each one of these plugins
Thanks in advance!

Hello @beagomezguillermo,

Welcome to the forum :tada:

I’ll try to reproduce your problem, but meanwhile, could you bring more details about the error you’re experiencing (error message, etc), please?

Thanks! :bowing_man:

The error is at compiling the k6ChaiJs in local env. The purpose of this is to ampliate the functionality of the library bringing me the option to use one of this plugins

  • chai-openapi-response-validator
  • api-contract-validator
    But it was imposible for me, the only error i get is that compile fails cause of require(‘api-contract-validator’).chaiPlugin;
    // Import this plugin
    import chaiResponseValidator from ‘chai-openapi-response-validator’;
    // Load an OpenAPI file (YAML or JSON) into this plugin
    which is necessary to use one of the plugins. Im cannot follow the Tutorial because that plugin used in there is much simplier than these two.
    I know it is cause of im not an expert in JS or TS
    Thanks in advance!