Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

10mock

Mid testing mock server for client-side testing.

apimocknockreact-nativeresttest
Published27 Jan 2021
Direct dependencies11
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 11

Native requirements
11 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
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/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-SQyGONtCd974TQo72zihOoiTv2vF420y3d+ApEUcwBSQxsqyi7GSIarQNp2Ucmj1hdNWSoBH7FMJwAyl6YYc5Q==",
  "shasum": "7f8923406a9bc2a4c1c236c6f215175490ae0a1b",
  "tarball": "https://registry.npmjs.org/10mock/-/10mock-1.0.0.tgz",
  "fileCount": 9,
  "unpackedSize": 8751,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEYRBCRA9TVsSAnZWagAADXYP/jsUF0W6CIlJ4rdyo5c2\nDCJng81Cz8POPi7UGowy9E6a3js6sAMYb1EhRlLMo0kMWYIGaLPpleQrMy6A\nzvDRHcHGy67BoSs05Aqxke222s8XK6ZhHpeAiDGaccrZh9l5Rwyall3Zd0cq\nfkrsbs48d7QhDuv56vHtvRZUTU88D1cXlkqXrphtw8X5yL2A2nVZCQAataw2\nqKCBpdLE1CR1Sq03FBqj8yrwicFeJygxYhwvv6WPs+1TcNPG38eBXc4S8RsD\n94uw6uo+OrNqEzAnZL7wt1zY62XdiBZ3Jcf7QcHZDiJuGe43YjwQ+q7m/SGW\n/zKlQzvw2NvnQaNvTWJ1hV2eXy1FbcVdu17Da0miuiEH5Wft1s/a1Gu3XwiU\nsgy/OjAS1u/lztEO34TqL1k8pGDSoRvJzN3P+jve+jGRopIjlsWbCVYAlmbH\nV/eiMTiTTD4Iy7pWQGQ/ptiVUHYyMuStRvCv1TRMPmU5W9Pfd2LMMBhhk3o/\n3WAEYNCOvzeklOcPdx4DdqxOB2yR3Lg+k4hFedSVwj81Xy//ekj4+tzcj1e4\nVp2BtWUm5ZjkBEwwvFGXHqZkt3lecHPSPeHvFccvVTDf0f8Fr7lHE/NH2PKL\nlSf9hOAE7oO2LsizV2ECFBNfRTk9LC+pIh2m5WcHqQGFkFOU1UXPPX4BWBKw\nem1i\r\n=QmEr\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDLhzWwq9uxySlyj+Lwd3XTkiJjEUfaVYvUqLSgPfYDdAIhAMRFT7/DA7yD/lbG4yaV0oWIIOnS+ylsWU2wzsklzNkS"
    }
  ]
}

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:43f391118d70e28f3042ac8f62e2d1cf27b773b35eea72bca3ff2e4aeeb98aa6

Other collected versions

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