wiremock-easy-client
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

wiremock client

This library can be used if a Wiremock instance is running, to interact like the actions given in the api http://wiremock.org/docs/api/

Usage

import { WiremockHelper, stubForOkResponseWithBody, forGetRequestMatchingUrl} from 'wiremock-client';

const wiremockClient = new WiremockHelper();
/*
Sample mapping to be configured in wiremock server
{
    request: {
        url: '/sample/path',
        method: 'GET'
    },
    response: {
        status: 200,
        jsonBody: {
            "greeting": "Hello world."
        }
    }
}
 */
const sampleMapping = stubForOkResponseWithBody(
    forGetRequestMatchingUrl("/sample/path"), 
    '{"greeting": "Hello world."}'
    )       

wiremockClient.addMapping(sampleMapping);

Readme

Keywords

Package Sidebar

Install

npm i wiremock-easy-client

Weekly Downloads

7

Version

1.4.1

License

MIT

Unpacked Size

73.8 kB

Total Files

24

Last publish

Collaborators

  • timnederhoff