Skip to content

Javascript client for Wiremock mappings and request journals

License

Notifications You must be signed in to change notification settings

timnederhoff/wiremock-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Javascript client for Wiremock mappings and request journals

Resources

License

Stars

Watchers

Forks

Packages

No packages published