Checkly changelog
Checkly changelog
checklyhq.com

`require` snippets in Browser checks

 

Improvement

  

You can now use the standard Node.js require() syntax to import code snippets into your Browser checks, where we first only supported Handlebars templates.

Here's an example:

  1. Create a login routine you want to reuse in Browser check scripts. Export it as a function

image.png

  1. Now require the snippet from the ./snippets directory — just like JS file — and call the function passing in the relevant parameters.

CleanShot 2022-06-10 at 14.45.09@2x.png

Read more in our docs on how to use this new syntax.

This is now the recommended way to DRY up your code. The legacy Handlebars notations is still usable till further notice.