New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

codeceptjs-webhook-helper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codeceptjs-webhook-helper

CodeceptJS helper for testing webhook calls

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
75
4.17%
Maintainers
1
Weekly downloads
 
Created
Source

codeceptjs-webhook-helper

codeceptjs-webhook-helper is a CodeceptJS helper to be able to test webhook calls during the tests.

How it works

This helper creates a simple http server with nodejs's http library, with a given port on the localhost. Before using, you need to set your webhook urls to the http://localhost:<given_port_in_the_config>/**

Installation

npm i codeceptjs-webhook-helper --save

Configuration

codecept.conf.js

helpers: {
    WebHookHelper: {
        require: 'codeceptjs-webhook-helper',
        port: 9999,
        waitForTimeout: 10
    }
},

Options:

  • port: The port to start the webhook server. Default is 5431
  • waitForTimeout: Indicates for how many seconds to wait for verifying the given webhook called or not during I.waitForWebHookCall(). Default is 10 seconds

Usage

// Wait for a webhook call: "/testing/with/codecept"
I.waitForWebHookCall('/testing/with/codecept')

// Wait for a webhook call: "/testing/with/codecept" 
// with overriding the wait timeout in the options. 
// This will wait for 20 seconds
I.waitForWebHookCall('/testing/with/codecept', 20) 

Todos:

  • Add a new method waitForWebHookCallWithPayload
  • Improve documentation

Keywords

codeceptJS

FAQs

Package last updated on 02 Jan 2021

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