Catalog npm
Back to packageRELEASE DETAILS

1.0.14

npm

10mock

Mid testing mock server for client-side testing.

apimocknockreact-nativeresttest
Published27 May 2021
Direct dependencies13
Transitive dependenciesNot calculated

README

Current package documentation

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 <port> run the mock server on the specified port, default port is 8000.
  2. -x <server url> 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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 13

Native requirements
13 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
cors
Environment
{
  "local_name": "cors",
  "alias": false,
  "peer_metadata": null
}
^2.8.5runtime
express
Environment
{
  "local_name": "express",
  "alias": false,
  "peer_metadata": null
}
^4.17.1runtime
stdio
Environment
{
  "local_name": "stdio",
  "alias": false,
  "peer_metadata": null
}
^2.1.1runtime
@types/express
Environment
{
  "local_name": "@types/express",
  "alias": false,
  "peer_metadata": null
}
^4.17.9development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^26.0.23development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^14.14.20development
@types/supertest
Environment
{
  "local_name": "@types/supertest",
  "alias": false,
  "peer_metadata": null
}
^2.0.10development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^26.6.3development
nodemon
Environment
{
  "local_name": "nodemon",
  "alias": false,
  "peer_metadata": null
}
^2.0.7development
supertest
Environment
{
  "local_name": "supertest",
  "alias": false,
  "peer_metadata": null
}
^6.0.1development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
^26.4.4development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^9.1.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.1.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-p/tLbLwzpzpFPpv+dpde8+GoIPtfkURbMa6WaBubHRnu4fWUEN5vjh7we1X83dJSyYVJNhSm0hJaof7G/8jCNQ==",
  "shasum": "d03837815dcc92656aa69b82f407d7975c1b2839",
  "tarball": "https://registry.npmjs.org/10mock/-/10mock-1.0.14.tgz",
  "fileCount": 8,
  "unpackedSize": 18410,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr6slCRA9TVsSAnZWagAAYsUP/1pkn6cX829Skg2qr3Nj\n4HGELzyx5FhFjclrVOXf73J4mtqAWS1GNIW3B4QI40MvVHGE50uyo2Zo7Hps\n3w8xkrBvmqJfrHwOMvdCZgnZpRlhAMQVWufdbpJntsnlJiU0wlVTcnAR8iwA\n4HggYhgLVsCjFJXZYiHXwcWTHcxioZhHeACFGbK9sb9cwTKHqEzB6gL/nZ75\nGrBgJvR2H0jx+gMilD1pBVIJx+OYn9NGaf0wH6autmOY1OEQWGMKhCidmtD8\nDzCqqFbB+mXJCZd0SDgiFWVarbynrGIHgicC+V6WZBmZH2frtC/H8VB69PNA\nEQksiT1yKei+AJbC7ER7qTJek49T54jVXHmVEDYxN8adNLj6Vo/fQUDoHQ4W\nQaWg5IXfY8zFkPMp5UcG2SyRnSAM6PLttBeG/EN6R+UpV6Ef+CFp/FLd6TMN\nEALJxZx9TKLnuyqH8qJzJqf++s3nAuJ2O2NrSwuzv+kCWwjz+O587BMmj/pz\nMZnPpBpME/7XF4ZixQOL2DzfO0IvUy5BHiKh3LCIsr50v0P3zm8nI01q+rqD\nb+G040rC6nUly8/mE5kQyzEyMtXDypLvMH9gK42jBtIaDIsBC62UflbwHrqY\nas7y9HH75/EsI7uo6ccEuqivQxp/kKih554lSgdxfwNvK58phhLrf0aIQ8uw\nao5q\r\n=Sl9J\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIG8Lh74Orh1BMv0ltjUAQLB4Xz8Fm6c2DDOVnunP+nsJAiEA0guz021djXGoUhG+MvcFZLVCpgHW+6VS8YknbKWGvIM="
    }
  ]
}

Repository

PENDING
10play/10mock

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d6c63e2999ba8fa786bde52af4dffbd8533d2194a0fb0bf94901d7fa1a492527

Other collected versions

1.0.1527 May1.0.1327 May1.0.1227 May1.0.1126 May1.0.1026 May1.0.926 MayView all collected versions →