Function When_I_intercept_URL_and_stub_body

  • When I intercept URL and stub body:

    When I intercept URL {string} and stub body {string}
    

    Parameters

    • url: string
    • body: string

    Returns void

    Intercept HTTP request and stub body with JSON:

    When I intercept URL "/api/users/1" and stub body '{"name":"Mark"}'
    

    Intercept HTTP request and stub body with text:

    When I intercept URL "/page" and stub body "Text"
    

    All intercepts are automatically cleared before every test.