Tests and ScriptsScriptInbuilt Libraries

Inbuilt Libraries

Bruno supports CommonJS syntax require for importing libraries. ES Modules import/export are not supported at this time.

Here’s an example demonstrating how to use the chai library in Bruno:

const chai = require('chai');
 
const { expect } = chai;
 
function add(a, b) {
  return a + b;
}
 
const result = add(2, 3);
 
expect(result).to.equal(5);
 
console.log('Test passed!');

You can include this code in the pre-request script section of Bruno to test it out.

Below is the list of inbuilt libraries supported by Bruno.

  • axios - Promise based HTTP client for the browser and node.js
  • atob - Turn base64-encoded ascii data back to binary.
  • btoa - Turn binary data to base64-encoded ascii.
  • chai - BDD/TDD assertion library for node.js and the browser.
  • moment - Parse, validate, manipulate, and display dates and times in JavaScript.
  • uuid - For the creation of RFC4122 UUIDs.
  • nanoid - A tiny, secure, URL-friendly, unique string ID generator for JavaScript.
  • crypto-js - JavaScript library of crypto standards.
⚠️

To use below inbuilt libraries in Bruno, you must be in Developer Mode.

  • node-fetch - A light-weight module that brings Fetch API to Node.js.
  • lodash - A modern JavaScript utility library delivering modularity, performance & extras.
  • ajv - Ajv JSON schema validator.
Last updated on