Giter Club home page Giter Club logo

nestjs-testing's Introduction

NestJs Testing

CI

What be this? What be this? There be bits errywhere!

This application is to be used as an exemplary setup for NestJs using modern best practices such as TDD, CI/CD and Aspect Oriented Programming.

Dynamic Providers

The concept is to have a single controller entrypoint that dynamically resolves the required service. In this application design, the dynamic providers are the unique VEHIKL offices (forest-city, kw, hammer-squad) which each have their own unique interfaces and interaction methods.

The resolved service provider supports a common interface and data shape.

Setup

  1. Ensure you are using the correct version of node by running nvm use
  2. Install dependencies using yarn
  3. There yah go!

Debugging

There are two different debugging scenarios:

Running the application

To debug the running application run :

yarn debug:api

Then connect your vscode debugger by using the included launch.json configuration for Debug Nest App.

Boom!

Tests

To debug your test suite, run the included configuration in the launch.json for Jest Tests.

Scaffolded using NX

Build

Run nx build my-app to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run nx test my-app to execute the unit tests via Jest.

Run nx affected:test to execute the unit tests affected by a change.

Running end-to-end tests

Run ng e2e my-app to execute the end-to-end tests via Cypress.

Run nx affected:e2e to execute the end-to-end tests affected by a change.

Understand your workspace

Run nx dep-graph to see a diagram of the dependencies of your projects.

Further help

Visit the Nx Documentation to learn more.

Continuous Integration

Continuous Integration (CI) has been setup using GitHub Actions. Please refer to the ci.yml file for specifics.

Linting and tests are executed, and a test coverage report is posted to the corresponding PR.

The current CI build status is displayed on the README as a badge:

CI

(If the above is red, someone screwed up.)

Coverage Reports

Coverage reports are posted as an autogenerated PR comment, if the CI pipeline is configured with a valid NX_GITHUB_API_TOKEN.

To run the coverage report locally, it is easiest done with

yarn test:api:coverage

nestjs-testing's People

Contributors

miking-the-viking avatar tbauman88 avatar jacob-gardiner avatar joshgaber avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

vehikl

nestjs-testing's Issues

Is it web scale?

I just need to know if this is web scale. I can't use this if it's not.

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.