Coder Social home page Coder Social logo

samuelb7 / testing-nestjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jmcdo29/testing-nestjs

0.0 0.0 1.0 10.65 MB

A repository to show off to the community methods of testing NestJS including Unit Tests, Integration Tests, E2E Tests, pipes, filters, interceptors, GraphQL, Mongo, TypeORM, and more!

License: MIT License

Shell 0.16% JavaScript 12.26% TypeScript 86.87% HTML 0.43% Handlebars 0.07% Dockerfile 0.22%

testing-nestjs's Introduction

Commitizen friendly Continuous Integration Testing Coffee

Nest Logo

testing-nestjs

A repository to show off to the community methods of testing NestJS including Unit Tests, Integration Tests, E2E Tests, pipes, filters, interceptors, GraphQL, Mongo, TypeORM, and more!

Project Structure

Each folder is a fully functional Nest application on its own. All you need to do after cloning the repository is move into the folder, install the dependencies, and test! Or you could just, you know, look at the test on GitHub too, no big deal.

Motivation

I've noticed a lot of people seem to get stuck on testing, and how to do it using the utilities given to us by Nest. Hopefully with a community driven repository of tests it will help others get a better understanding and feel for how to get tests running.

Please Note

This is not necessarily the Nest canonical way to test an application, nor is it the only way in any scenario. I will do my best to show different ways to run tests, but I will more than likely miss certain ways of running the tests, whether it is mocking in a specific way or otherwise. Again, this is a community maintained project and not a part of the official documentation. If you find other ways to test applications, great, I'd love to see them, but please do not think this is the only way.

Running the Project

  1. git clone https://github.com/jmcdo29/testing-nestjs.git
  2. cd testing-nestjs/<folderName>
  3. npm install OR yarn add OR pnpm install
  4. npm run test OR yarn test OR pnpm test

Contributing

Did I miss your favorite topic? Did I miss out on something you absolutely need tested? Well then open an issue, or better yet, a pull request! I'll be happy to look over any topics and try to help figure out how to test them or to merge any PRs that add to the value of the repository. If you do end up making a pull request, please add a screenshot of the test coverage so others can see how well the tests run. The complex-sample branch has a good example.

Change log

The change log can be found on the Releases page.

Authors and license

Jay McDoniel and contributors. Thanks to everyone who's helping with this effort!

MIT License, see the included License.md file.

testing-nestjs's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jmcdo29 avatar tony133 avatar rostgoat avatar tak1n avatar malcolm-kee avatar neerajkumar161 avatar szolowicz avatar jeffminsungkim avatar mnigos avatar milesq avatar ddehghan avatar wonderpanda avatar micalevisk avatar webbly25 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.