2.4.0 • Published 1 year ago

airview-mock-server v2.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Airview Mock Server

Airview Mock Server provides seed data and mock API endpoints for use with airview-cms package. Its intent is to allow:

  1. local development, without hitting the real GitHub API
  2. A reliable service to facilitate testing

Installation

The package can be installed via npm, within your working directory run:

npm i airview-mock-server

Note: A requirement for the project is node.js LTS, currently greater that version 16.15.1 but less than version 17.0.0

Setup and Configuration

The package has a dependency of Mock Service Worker; documenting MSW package is outside the scope of this README, therefore an understanding of this library is a prerequisite.

AirviewMockServer

Airview Mock Server exports a function AirviewMockServer; this accepts arguments to configue the service and will return the nessesary Mock Service Worker handlers and helper methods

Signature:

  • Name: airviewMockServer
  • Arguments:
    • delay: string - delay in milliseconds, defaults to 500 - optional
    • domain: string - domain prefix for MSW calls, defaults to null - optional
  • Returns: object
    • handlers: array - an array of Mock Service Worker handlers
    • resetStore: function () => void - resets the seed data

Example:

import { setupWorker } from "msw";
import { AirviewMockServer } from "airview-mock-server";

function initAirviewMockServer() {
  const { handlers } = new AirviewMockServer(500);
  const worker = setupWorker(...handlers);
  worker.start();
}

initAirviewMockServer();

Contributing to the package

Please see our documentation here for guidance

Issues, bugs and feature requests

Please see our documentation here for guidance

2.4.0

1 year ago

2.2.3

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.9

1 year ago

0.1.1

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.17

1 year ago

2.3.16

1 year ago

0.2.1

1 year ago

2.3.13

1 year ago

2.3.12

1 year ago

2.3.15

1 year ago

2.3.14

1 year ago

2.3.11

1 year ago

2.3.10

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.0.53

1 year ago

0.1.0

1 year ago

0.0.52

1 year ago

0.0.51

1 year ago

0.0.50

1 year ago

0.0.49

2 years ago

0.0.48

2 years ago

0.0.47

2 years ago

0.0.46

2 years ago

0.0.45

2 years ago

0.0.44

2 years ago

0.0.43

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago