diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index abce4d64774..4ed7f17ccba 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -32,7 +32,7 @@ In case you are suggesting a new feature, we will match your idea with our curre * Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli). * `git clone && cd webpack-cli` -### Setup with npm +### Using npm * Install the dependencies and link them: @@ -49,68 +49,81 @@ In case you are suggesting a new feature, we will match your idea with our curre npm run build ``` -* Run all the tests with: +### Using yarn + +* If you don't have yarn yet: ```bash - npm run test + npm install -g yarn ``` - -* To test a single CLI (flag) test case: +* Install the dependencies and link them + ```bash - BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js` + yarn + yarn link + yarn link webpack-cli ``` -* To test a single CLI (other type of) test case: - - `npx jest path/to/my-test.js` - - You can also install jest globally and run tests without npx: - - `npm i -g jest` - - If you have jest installed globally: - - `jest path/to/my-test.js` +* Bootstrap all the submodules before building for the first time -* To test linting: ```bash - npm run lint && npm run tslint + yarn bootstrap + yarn build ``` -### Setup with yarn -* If you don't have yarn yet: + +## Testing + +### Using npm + +* Run all the tests with: ```bash - npm install -g yarn + npm run test ``` + +* Test a single CLI test case: -* Install the dependencies and link them + ```bash + npx jest path/to/my-test.js + ``` + +* You can also install jest globally and run tests without npx: ```bash - yarn - yarn link - yarn link webpack-cli + npm i -g jest + jest path/to/my-test.js ``` -* Bootstrap all the submodules before building for the first time +* You can run the linters: ```bash - yarn bootstrap - yarn build + npm run lint && npm run tslint ``` +### Using yarn + * Run all the tests with: ```bash yarn test ``` -* To test a single CLI (flag) test case: +* Test a single CLI test case: ```bash - BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js + yarn jest path/to/my-test.js ``` + +* You can also install jest globally and run tests: -* To test a single CLI (other type of) test case: - - `yarn jest path/to/my-test.js` + ```bash + yarn global add jest + jest path/to/my-test.js + ``` -* To test linting: +* You can run the linters: ```bash yarn lint && yarn tslint