0.3.2 • Published 5 years ago

@hackliff/mockingbird v0.3.2

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Build Status codecov

Highlight

  • Declarative API description
  • Endpoints as code to fit all use cases
  • Generate data - on the fly or beforehand for more control
  • Easily switch scenarios to simulate different use cases
  • Support swagger to easily share and interact with the API contract
  • Emulate complex scenarios:
    • request delays
    • todo authentication

In a Nutshell

# all you need is 5min - let's get started
npm install -g mockingbird

mkdir -p nasa/scenarios && cd nasa

Write a scenario

// in ./scenarios/build.js

const success = (req, res) => res.status(204).json({ request_id: Math.random() })

module.exports = { success }

Write some config

title: 'NASA'
storage: 'json'

scenarios:
  - name: healthcheck

endpoints:
  - description: 'build spaceship'
    method: POST
    module: ./scenarios/build
    uri: /v2/spaceships
    scenario: async success
    latency: 4000

Serve a full-featured API: mockingbird serve --port 4000

Profit: curl -X POST -d '{ "engine": "nuclear" }' localhost:4000/v2/spaceships

Installation

Usage

Configuration

Scenarios


Workflow

Release

We follow a few industry standards.

  • Git flow
  • Semantic release
  • Release notes are only generated for major releases.

Local issue tracker

To be progressively migrated to github issues as we release it open source

The project manages todos using taskbook. After installing dependencies, source .env to update its configuration and use the local database.

Then use it as indicated on the github readme: npx tb -i.