From 62fb9d7bbce31e6f583ded1ce21282574bae82b5 Mon Sep 17 00:00:00 2001 From: Pavlo Buidenkov Date: Fri, 12 Feb 2021 17:32:29 +0200 Subject: [PATCH 1/2] more precise doc on how to update failing test snapshots --- README.md | 15 +++++++++++++++ ...-a-typo-in-existing-translation-of-Deskreen.md | 14 +++++++------- ...to-add-new-language-translation-to-Deskreen.md | 14 +++++++------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f63be48..e904d10 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,21 @@ globally on your machine. `yarn coverage` -- when run from project root, generates a coverage report for `host` and `app/client` +### How to regenerate snapshots if you have tests failing when running `yarn test`? + +in root `./` folder of project run this: + +``` +yarn test --updateSnapshot +``` + +in Deskreen Viewer `./app/client` folder of project run this: + +``` +cd app/client +SKIP_PREFLIGHT_CHECK=true yarn test:nowatch -- -u +``` + ## Instruction for running a local Sonar Qube, community edition ### Prerequisites diff --git a/doc/translations-docs/fix-a-typo-in-existing-translation-of-Deskreen.md b/doc/translations-docs/fix-a-typo-in-existing-translation-of-Deskreen.md index 927cef7..8ba6756 100644 --- a/doc/translations-docs/fix-a-typo-in-existing-translation-of-Deskreen.md +++ b/doc/translations-docs/fix-a-typo-in-existing-translation-of-Deskreen.md @@ -115,21 +115,21 @@ Docs coming soon. Stay tuned. ### When the Deskreen App edits done, then please fix tests if they are broken. And regenerate snapshots if needed. -Example to regenerate snapshots: -in root `./` folder of project +### How to regenerate snapshots if you have tests failing when running `yarn test`? + +in root `./` folder of project run this: ``` -yarn test -- -u (or yarn jest -- -u) +yarn test --updateSnapshot ``` -in root `./app/client` folder of project +in Deskreen Viewer `./app/client` folder of project run this: ``` -yarn test -- -u (or yarn jest -- -u) +cd app/client +SKIP_PREFLIGHT_CHECK=true yarn test:nowatch -- -u ``` -If that doesn't work for you to regenerate snaphosts, please google search how to do it. - ### IMPORTANT: Please make sure your PR is 1 or maximum 2 commits length. If it is longer than that, you will be asked to squash your PR commits. If you don't know how to squash, refer [this guide](#dont-know-code) ### After you done fixing, please submit your PR, it will be reviewed and if everything is ok it will be merged and you fix will be included in next release. Thank you! diff --git a/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md b/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md index 0a6f120..a5a4369 100644 --- a/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md +++ b/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md @@ -146,21 +146,21 @@ You need to add it in two places: 1. host app, that runs on a computer and 2. cl ### When the Deskreen App translations done, then please fix tests if they are broken. And regenerate snapshots if needed. -Example to regenerate snapshots: -in root `./` folder of project +### How to regenerate snapshots if you have tests failing when running `yarn test`? + +in root `./` folder of project run this: ``` -yarn test -- -u (or yarn jest -- -u) +yarn test --updateSnapshot ``` -in root `./app/client` folder of project +in Deskreen Viewer `./app/client` folder of project run this: ``` -yarn test -- -u (or yarn jest -- -u) +cd app/client +SKIP_PREFLIGHT_CHECK=true yarn test:nowatch -- -u ``` -If that doesn't work for you to regenerate snaphosts, please google search how to do it. - ### By this time you should be done with adding a translation. ### Add new language for Deskreen Website. Step By Step Guide for coders and people who know how to use git From 7695589812a3b6856dcb7cb6c7d5a0c548e576c5 Mon Sep 17 00:00:00 2001 From: Pavlo Buidenkov Date: Fri, 12 Feb 2021 17:41:58 +0200 Subject: [PATCH 2/2] better translation docs` --- .../how-to-add-new-language-translation-to-Deskreen.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md b/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md index a5a4369..4a5bdb1 100644 --- a/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md +++ b/doc/translations-docs/how-to-add-new-language-translation-to-Deskreen.md @@ -134,6 +134,8 @@ You need to add it in two places: 1. host app, that runs on a computer and 2. cl "es": "Espagnol", .... ``` +- In `getShuffledArrayOfHello`(search for arrow function) add a Hello word in your language to `res` list like this: `res.push(translationES.Hello);`. You will first need to import `translationES` on a top of file where this arrow function is. Example: `import translationES from '../locales/es/translation.json'` + - Done with the host app! - Now proceed with client viewer. Create a directory `es` in `app/client/public/locales` - create `app/client/public/locales/es/translation.json`