1.0.15 • Published 5 months ago

10mock v1.0.15

Weekly downloads
24
License
ISC
Repository
github
Last release
5 months ago

10mock

mockserver is a lightweight library that will help you mock your APIs requests fast and easy.

Installation

10mock can be installed globally :

npm install -g 10mock

10mock -p 8080
[10mock]: Server is running at http://localhost:8080

or as a regular NPM module:

npm install -D 10mock
npx 10mock

[10mock]: Server is running at http://localhost:8000

Available options:

  1. -p \ run the mock server on the specified port, default port is 8000.
  2. -x \ run the mock server as proxy server

10mock also supplies easy to use client:

import Api from '10mock';
export const api = new Api(optional-port);

10mock server client usage:

  1. api.finishTest() - remove all mocked routes.
  2. api.nock(path).method(method).status(status).send(mocked-response);
  • Create new mocked route returns object with these entities:
    • getCount function thats returns the number of requests sent to this route.
    • getStubRequests function thats returns all the requests sent to this route.
    • getStats function thats returns getStubRequests and getCount results.
    • deleteRoute function thats remove this mocked route.
1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.2

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.1

9 months ago

1.0.0

9 months ago