Test - Mock

Testing Infrastructure

About

Mocking is just replacing or wrapping a function by another function at runtime called a mocking function.

Example:

var request = new HttpRequest(); // the real request
var mockRequest = new HttpMock(request); // the request is wrapped

This function overrule the actual implementation of a function during a test.

It permits then to:

  • control the passed parameters
  • return a known value or behavior.

Mock function are generally used to simulate a integration test with third party services such as:

Framework

Java:

Javascript:





Discover More
Browser
Browser - Fetching Resources (Request/Response)

This article is fetching (http request/response) in the browser. User agents can implement a variety of transfer protocols to fetch resources such as: HTTP : , ... Form FTP ... rendering...
HTTP - Test

Name Technology NTF (Network Testing Framework) Node See mock
Java Conceptuel Diagram
Java - Test Tool

- assertion library assertThat - library (Findbugs) - ...
Jest - Mock

in Jest Mocking is just replacing a function by another called a mocking function. In Jest mocking function can replace the code executed but they also record all call made to them creating a command...
Testing Infrastructure
Mock Service Worker

is a mocking app for HTTP request that: intercepts requests at the network layer and returns data as simple objects via mock handlers defined in a file. You can write everything...
Testing Infrastructure
Testing - Mock server (Mock Backend)

mock server are backend application that mocks a real one by responding to request with pre-defined result. They are used mainly in the development of web application in order to mock a Web service (such...



Share this page:
Follow us:
Task Runner