Giter Site home page Giter Site logo

jmfiola / jest-api-test-typescript-example Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 5.0 442 KB

An example repository which provides the necessary boilerplate for a reusable and maintainable jest test framework

License: MIT License

JavaScript 0.94% TypeScript 99.06%
jest typescript rest-api test-automation test-framework testing-tools typescript-tests restful-api api-testing api-testing-framework

jest-api-test-typescript-example's Introduction

Build Status Forks Stargazers Issues MIT License LinkedIn


Logo

Jest Api Test Framework: A TypeScript Example

This is an example repository which provides the necessary boilerplate code for a reusable and maintainable jest api test framework using TypeScript.
Report Bug ยท Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

This is a basic test framework that hits the Chuck Norris Jokes API following 3 core values:

  1. Endpoint functionality should be wrapped by a class method which is abstracted as much as possible ๐ŸŒŒ

  2. Those class methods should be unit tested ๐Ÿงช

  3. Actual API tests will then import those class methods to interact with the live API ๐Ÿ”Ž

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

You will want the latest version of npm installed. For reference, this project was developed with npm version 8.5.1.

npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://github.com/jmfiola/jest-api-test-typescript-example.git
  2. Install NPM packages
    npm install
    

(back to top)

Usage

  1. Run the unit tests for the framework with code coverage
    npm run unit:test
    
  2. Run the functional tests which actually hit the live Chuck Norris API
    npm run functional:test
    

You can use this framework as a starting point for whatever API tests you would like to run. This framework allows for the flexibility of running tests which have free range with what headers they use, what routes they call, etc. whilst also providing easy-to-use, reusable, unit tested class methods. This makes the tests a lot more accessible to test writers and framework maintainers!

(back to top)

Roadmap

  • Dockerization
  • Reporting Integration
  • Tag-based test collection

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. My venmo is @Jacob-Fiola! ๐Ÿ˜‰

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/jmfiola/jest-api-test-typescript-example

Email: [email protected]

(back to top)

jest-api-test-typescript-example's People

Contributors

jacobfiola avatar jmfiola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.