From f64c736a040866f8a2842fa72ed36d36173e2953 Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Wed, 6 Dec 2023 17:34:21 +0100 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20add=20testing=20&=20di?= =?UTF-8?q?=20section=20+=20toc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01a6d56..5ea7526 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ # 💃 The Limbo Game 🕺 +# Table of Contents + +- [Context](#context) +- [Rules](#rules) +- [App requirements](#app-requirements) +- [Scoring system](#scoring-system) +- [Useful information & resources](#useful-information--resources) + - [A list of recipes to fill the database with](#a-list-of-recipes-to-fill-the-database-with) + - [Docs](#docs) + - [Testing & Dependency Injection](#testing--dependency-injection) +- [Useful commands](#useful-commands) + - [Running build, lint & tests](#running-build-lint--tests) + - [Limbo](#limbo) + - [Autorevert](#autorevert) + - [TCR](#tcr) + ## Context Conventional development workflows _(i.e. based on branching, PRs, Code Review, manual testing, etc...)_ will often have the following drawbacks: @@ -40,7 +56,7 @@ In this workshop, we will restrict ourselves with some extreme rules _(cf. [Rule - `-5` points for each CI workflow failure _(except missing visual regression snapshots)_. - **🚨 CHEATING 🚨** : 15 minutes AFK penalty for the whole team. -## Tips and useful resources +## Useful information & resources ### A list of recipes to fill the database with
@@ -209,6 +225,14 @@ In this workshop, we will restrict ourselves with some extreme rules _(cf. [Rule - [Playwright Component Testing](https://playwright.dev/docs/test-components) - [Vitest Assertions](https://vitest.dev/api/expect.html) +### Testing & Dependency Injection + +In order to replace dependencies with Test Doubles (e.g. fakes), we are using: + +- for the frontend: React Context API. Cf. [greetings.pw.tsx](apps/whiskmate/src/app/greetings/greetings.pw.tsx) & [greetings.client.fake.tsx](apps/whiskmate/src/app/greetings/greetings.client.fake.tsx) for an example. +- for the backend: Tsyringe _which is wrapped in [di.ts](apps/recipes-api/src/di.ts)_. Cf. [greetings.router.spec.ts](apps/recipes-api/src/greetings/greetings.router.spec.ts) for an example. +- you can also stub requests at HTTP level with Playwright. Cf. [Playwright Handle Requests](https://playwright.dev/docs/network#handle-requests). + ## Useful commands ### Running build, lint & tests