Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module ajv #3915

Open
2 tasks done
Salokyn opened this issue Jan 30, 2025 · 0 comments
Open
2 tasks done

Cannot find module ajv #3915

Salokyn opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Salokyn
Copy link

Salokyn commented Jan 30, 2025

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

Hi,

I use ajv module to test json schema of api file.

It used to work, but since b1.38.1 (or 1.38 maybe?).

In Test tab:

function testSchema (schema) {
  const Ajv = require("ajv");
  const addFormats = require("ajv-formats");
  const ajv = new Ajv();
  addFormats(ajv);

  const validate = ajv.compile(schema);
  const data = res.getBody();
  const valid = validate(data);
  
  if (!valid) console.error(validate.errors);

  return valid;
}

test("Response schema is valid", function () {
  return expect(testSchema(schema)).to.be.true;
});

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Image

@Salokyn Salokyn added the bug Something isn't working label Jan 30, 2025
@sreelakshmi-bruno sreelakshmi-bruno self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants