From 87f153a256449627f99cf795f9c4f64023f667bf Mon Sep 17 00:00:00 2001 From: Dave Gordon Date: Mon, 3 Jun 2024 19:55:03 +0100 Subject: [PATCH] [readme] chore: Readme for yarn --- README.md | 49 ++++++++++++++++++++++---------------------- backend/README.md | 28 +++++++++++++++++-------- frontend/README.md | 8 ++++---- playwright/README.md | 16 +++++++-------- 4 files changed, 55 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 5a2d2514..3d5c9b33 100644 --- a/README.md +++ b/README.md @@ -15,21 +15,33 @@ Refactored the app for testability and added a few additional tweaks. [https://notes-app-full-stack-bjml.onrender.com/](https://notes-app-full-stack-bjml.onrender.com/) -## Frontend - -### FE Implementation +## FE Implementation - React - Typescript - [Axios](https://axios-http.com/docs/intro) -### End to End Tests (e2e) +## BE Implementation + +- Node.js +- Typescript +- Express +- Postgres +- [Primsa](https://www.prisma.io/) (DB ORM) + +### Database + +- [Postgres](https://www.postgresql.org/) with Serverless hosting on [Neon](https://neon.tech/) + +## Test Layers + +### FE End to End Tests (e2e) [![Playwright e2e Production Tests](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/playwright-production-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/playwright-production-tests.yml) - [Playwright.io](https://playwright.dev/) with typescript - [Allure Production Test Report](https://helloitsdave.github.io/notes-app-full-stack-testing) with history -### Component Tests +### FE Component Tests [![Frontend Component Tests](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/frontend-component-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/frontend-component-tests.yml) - [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) with [vitest](https://vitest.dev/) @@ -39,30 +51,17 @@ Refactored the app for testability and added a few additional tweaks. ### FE Service Tests [![Frontend Service Tests - Playwright](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/frontend-service-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/frontend-service-tests.yml) -- Service tests with docker and [Playwright.io](https://playwright.dev/) - -## Backend +- docker and [Playwright.io](https://playwright.dev/) -### BE Implementation - -- Node.js -- Typescript -- Express -- Postgres -- [Primsa](https://www.prisma.io/) (DB ORM) - -### BE Tests +### BE e2e Tests [![Backend e2e Tests](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-e2e-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-e2e-tests.yml) -[![Backend Integration Tests](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-integration-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-integration-tests.yml) +- docker, [supertest](https://github.com/ladjs/supertest) and [vitest](https://vitest.dev/) -- e2e tests with docker, [supertest](https://github.com/ladjs/supertest) and [vitest](https://vitest.dev/) -- Integration tests with [supertest](https://github.com/ladjs/supertest), [vitest](https://vitest.dev/) and [vitest-mock-extended](https://github.com/eratio08/vitest-mock-extended) +### BE Integration Tests +[![Backend Integration Tests](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-integration-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-integration-tests.yml) +- [supertest](https://github.com/ladjs/supertest), [vitest](https://vitest.dev/) and [vitest-mock-extended](https://github.com/eratio08/vitest-mock-extended) -### Contract Tests +### API Contract Tests [![Backend Contract Tests](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-contract-tests.yml/badge.svg)](https://github.com/helloitsdave/notes-app-full-stack-testing/actions/workflows/backend-contract-tests.yml) - Contract tests with [pact](https://docs.pact.io/) - -## Database - -- [Postgres](https://www.postgresql.org/) with Serverless hosting on [Neon](https://neon.tech/) diff --git a/backend/README.md b/backend/README.md index eb79ac49..e43585be 100644 --- a/backend/README.md +++ b/backend/README.md @@ -9,19 +9,19 @@ Running the backend db and express server in a docker container ### Build ```bash -npm run docker:build +yarn docker:build ``` ### Run ```bash -npm run docker:up +yarn docker:up ``` ### Stop ```bash -npm run docker:down +yarn docker:down ``` ## Test Execution @@ -31,7 +31,7 @@ npm run docker:down Execute the integration tests ```bash -npm run test +yarn test ``` ### Integration Tests with Coverage @@ -39,17 +39,27 @@ npm run test Execute the integration tests with coverage ```bash -npm run test:coverage +yarn test:coverage ``` -### Service Tests +### e2e Tests Execute the service tests against the local docker container ```bash -npm run docker:up -npm run test:service -npm run docker:down +yarn docker:up +yarn test:e2e +yarn docker:down +``` + +### Contract Tests + +Execute the service tests against the local docker container + +```bash +yarn docker:up +yarn test:contract +yarn docker:down ``` ## Tag release diff --git a/frontend/README.md b/frontend/README.md index 76a966f5..60fb863e 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -8,7 +8,7 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo In the project directory, you can run: -### `npm start` +### `yarn start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. @@ -16,12 +16,12 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. -### `npm test` +### `yarn test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. -### `npm run build` +### `yarn build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. @@ -31,7 +31,7 @@ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. -### `npm run eject` +### `yarn eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** diff --git a/playwright/README.md b/playwright/README.md index bd2ed963..7560b90c 100644 --- a/playwright/README.md +++ b/playwright/README.md @@ -18,8 +18,8 @@ To use the tests in this folder, you need to have Playwright installed. ```bash cd ./playwright -npm ci -npx playwright install +yarn +yarn playwright install ``` ## Test Execution @@ -29,27 +29,27 @@ npx playwright install Start the backend server: ```bash cd ./backend -npm run docker:up +yarn docker:up ``` Start the frontend server: ```bash cd ./frontend -npm run start +yarn start ``` Executing tests against the local server: ```bash cd ./playwright -npm run test +yarn test ``` ### Running tests in production ```bash cd ./playwright -npm run test:production +yarn test:production ``` ### Headed mode @@ -58,7 +58,7 @@ By default, tests are executed in headless mode. To run tests in headed mode, pa ```bash cd ./playwright -npm run test -- --headed +yarn test -- --headed ``` ### Debug mode @@ -67,7 +67,7 @@ To run tests in debug mode, pass the `--debug` flag: ```bash cd ./playwright -npm run test -- --debug +yarn test -- --debug ``` ## Page Object Model