Skip to content

Commit

Permalink
docs(contributing): refactor & formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
misterdev committed Mar 10, 2019
1 parent 47fcd7f commit 1042cb2
Showing 1 changed file with 42 additions and 29 deletions.
71 changes: 42 additions & 29 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <your-clone-url> && cd webpack-cli`

### Setup with npm
### Using npm

* Install the dependencies and link them:

Expand All @@ -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
Expand Down

0 comments on commit 1042cb2

Please sign in to comment.