New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

artillery-plugin-expect

Package Overview
Dependencies
Maintainers
2
Versions
367
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

artillery-plugin-expect

Expectations and assertions for HTTP

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-81.86%
Maintainers
2
Weekly downloads
 
Created
Source

artillery-plugin-expect

Functional API testing with Artillery

Add expectations to your HTTP scenarios for functional API testing with Artillery.

🐞 Please report issues over at https://github.com/shoreditch-ops/artillery/issues

Usage

Install the plugin

npm install -g artillery-plugin-expect

Enable the plugin in the config section

config:
  target: "http://example.com"
  plugins:
    expect: {}

Use expectations on your requests

scenarios:
  - name: Get pets
    flow:
      - get:
          url: "/pets"
          capture:
            - json: "$.name"
              as: name
          expect:
            - statusCode: 200
            - contentType: json
            - hasProperty: results
            - equals:
              - "Tiki"
              - "{{ name }}"

Expectations

statusCode

Check that the response status code equals the code given.

expect:
  - statusCode: 201

contentType

Check the value of Content-Type header.

hasProperty

When the response is JSON, check that the response object has a property. Same as lodash#has.

expect:
  - hasProperty: 'data[0].id'

equals

Check that two or more values are the same. NOTE only primitive values (e.g. booleans, strings and numbers) are currently supported.

- get:
    url: "/pets/f037ed9a"
    capture:
      - json: "$.species"
        as: species
    expect:
      - equals:
          - "{{ species }}"
          - "dog"

License

MPL 2.0

FAQs

Package last updated on 14 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc