Git Product home page Git Product logo

puzzle's Introduction

Todo

  • Add license file and distribute to all repos using GitHub Action (Thomas)
  • Finish writing integration tests for puzzle endpoint (Thomas)
  • Write GitHub hook to run all tests before Push to repo (Thomas)
  • Set up Dev and Prod Lambda environments (Thomas/Gregory)
  • Add Mermaid documentation and distribute to all repos using GitHub Action (Thomas)
  • Clean up docker implementation (auto-rebuild) (Thomas)
  • Display integration test results with reporter (Thomas)
  • Decide on initial JSON structure for remaining endpoints (Team)
  • Write logic for remaining endpoints (Daniel)
  • Write sanitation and validation for remaining endpoints (Daniel)
  • Write Postman integration tests for remaining endpoints (Daniel)
  • Set up Auth0 token authentication (Thomas/Daniel)
  • Write up OpenAPI specifications for endpoints (Thomas/Daniel)
  • Resolve remaining //todo items (Thomas/Daniel)
  • Determine how to set Prod environment to use versioning control (Thomas/Gregory)
  • Implement unit tests if needed (Thomas/Daniel)

Developer Setup

  1. Install Docker on your machine. Tutorial is linked below:
    Docker Tutorial
  2. The Mongo image can be run with this command in the root folder:
    Note use sudo on Linux/Mac
npm run docker
  1. Create .env file with environment variables
  2. Run npm i
  3. The app can then be run with the command:
npm run start
  1. Integration tests can be run when the app is running with this command:
npm run test:integration

Postman

We are using Postman for integration tests.
The following video is very helpful for understanding how Postman works with GitHub:
Postman Tutorial

Below is an example structure for tests based on Puzzle endpoint

The Postman tests are structured based on the endpoint name, the type of request, and the expected response code

postman_structure.png

This structure allows us to write test cases for the Code 400 folder which would be run for all tests in that folder.

All tests for the Sudokuru-Backend have access to the Sudokuru-Backend Pre-request scripts and tests.
We currently have a Pre-request script that deletes the whole database before every test.
We also have a function that can be used for all DELETE requests to validate the response.

backend_pre_request_scripts.png

Inside the Puzzle endpoint folder we have shared functions to validate a puzzle response and to generate shared puzzle JSON for Pre-Request scripts for other tests.

puzzle_response_checker.png

The below functions take in an integer and return either valid JSON or an object for reference.

shared_puzzles_for_tests.png

Inside the "Code 201" folder we have a test case that will be run for all tests inside of the folder.

shared_response_code_test.png

puzzle's People

Contributors

thomas-gallant avatar

Stargazers

 avatar

Forkers

21yosh

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.