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

feat: expectjsonlength enhancement #298

Merged
merged 3 commits into from
Sep 3, 2023

Conversation

leelaprasadv
Copy link
Member

@leelaprasadv leelaprasadv commented Sep 2, 2023

closes #290

Support pactum matchers in expectJsonLength assertion.

Changes:

  • Allow pactum-matchers on expectJsonLength
    • allowed matchers - gte, lte, lt, gt. notEquals
  • semver vulnerability fix - updated via npm audit fix
  • Bump version to 3.5.1

Examples

const { spec } = require('pactum');
const { gte, lte, lt, gt } = require("pactum-matchers");

await spec()
  .get('https://reqres.in/api/users')
  .expectJsonLength('data', lte(6));
const { spec } = require('pactum');
const { gte, lte, lt, gt } = require("pactum-matchers");

await spec()
  .get('https://jsonplaceholder.typicode.com/users')
  .expectJsonLength('.', gte(10));

@leelaprasadv leelaprasadv changed the title Feat/expectjsonlength enhancement feat: expectjsonlength enhancement Sep 2, 2023
@leelaprasadv leelaprasadv added the enhancement New feature or request label Sep 2, 2023
@ASaiAnudeep ASaiAnudeep merged commit 1c85973 into master Sep 3, 2023
12 checks passed
@ASaiAnudeep ASaiAnudeep deleted the feat/expectjsonlength-enhancement branch April 30, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array length assertion
2 participants