From 41d833eac92332fe7452f0b8c0519a8dce019cc6 Mon Sep 17 00:00:00 2001 From: Jack Lewin Date: Sun, 1 Oct 2017 21:59:26 +0100 Subject: [PATCH] [Docs] Clarify dev workflow in CONTRIBUTING.md Explain that the test suite & linter run on built Enzyme; Add guidance on dev workflow --- CONTRIBUTING.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d7a91598..d89b96070 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,12 @@ npm run react:16 ### Running Tests +The test suite runs on *built* Enzyme. + ```bash +# build Enzyme locally before testing +npm run build + # run tests on whatever version of React is currently installed npm test ``` @@ -56,7 +61,14 @@ npm test npm run test:all ``` +If you are actively developing, Enzyme will always need to be built with the latest changes. + +For this, the recommended workflow is to have the build and tests watching for changes in separate terminals. This should provide you with ~realtime feedback: + ```bash +# build Enzyme locally upon save +npm run build:watch + # faster feedback for TDD npm run test:watch ``` @@ -66,10 +78,15 @@ npm run test:watch This codebase adheres to the [Airbnb Styleguide](https://github.com/airbnb/javascript) and is enforced using [ESLint](http://eslint.org/). -It is recommended that you install an eslint plugin for your editor of choice when working on this +As with the test suite, the linter will not fully pass unless it is running on *built* Enzyme. This is because the ESLint `import/*` rules rely on finding the target files in the filesystem (which won't be there unless they've been built). + +It is recommended that you install an ESLint plugin for your editor of choice when working on this codebase, however you can always check to see if the source code is compliant by running: ```bash +# build Enzyme locally before linting +npm run build + npm run lint ```