Giter VIP home page Giter VIP logo

blog-microservices-testing-nodejs-typescript's Introduction

Microservices testing with Node.js and TypeScript

This demo repository corresponds to this blog post. It shows a real world example for realization of the testing pyramid with TypeScript and Node.js in combination with Microsoft Azure.

Basically the project is serving a RESTful API for dealing with vehicles. The idea behind it, is that a vehicle can be created and retrieved. Moreover a list of all vehicles can be retrieved.

In order to demonstrate a RESTful microservice communication, the vehicle service can get more detailed information on the damage status from another service in this example. This looks like the following:

Prerequisites

Setup an Microsoft Azure CosmosDB Acoount with SQL API and set the following environment variables to the corresponding values of your created DB in order to be able to run the application:

  • DATABASE_URL
  • DATABASE_MASTER_KEY

Commands / scripts

Following npm scripts can be used to run, test and build the project:

  • start starts the compiled js output of the TypeScript compiler inside of an Azure App Service instance (do not use locally).
  • build compiles and lints the project.
  • serve starts the compiled js output of the TypeScript compiler locally.
  • serve-sim starts the compiled js output of the TypeScript compiler locally and connect to the simulation server (use this in combination with the simulation script in order to run the app locally).
  • ts:build compiles the project.
  • ts:doc creates the TypeDoc.
  • test runs all tests.
  • test:unit runs all unit tests.
  • test:int runs all integration tests.
  • test:contract runs all contract tests.
  • simulation starts the simulation server.

blog-microservices-testing-nodejs-typescript's People

Contributors

antoniq avatar slu-it avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.