Skip to content

Commit

Permalink
docs(contributing): refactor setup and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
misterdev committed Mar 10, 2019
1 parent 94387e7 commit ba672a4
Showing 1 changed file with 47 additions and 22 deletions.
69 changes: 47 additions & 22 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,25 +49,8 @@ In case you are suggesting a new feature, we will match your idea with our curre
npm run build
```

* Run all the tests with:

```bash
npm run test
```

* 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`

* To test linting:
```bash
npm run lint && npm run tslint
```
### Using yarn

### Setup with yarn
* If you don't have yarn yet:

```bash
Expand All @@ -89,16 +72,58 @@ In case you are suggesting a new feature, we will match your idea with our curre
yarn build
```


## Testing

### Using npm

* Run all the tests with:

```bash
npm run test
```

* Test a single CLI test case:

```bash
npx jest path/to/my-test.js
```

* You can also install jest globally and run tests without npx:

```bash
npm i -g jest
jest path/to/my-test.js
```

* You can run the linters:

```bash
npm run lint && npm run tslint
```

### Using yarn

* Run all the tests with:

```bash
yarn test
```

* To test a single CLI (other type of) test case:
- `yarn jest path/to/my-test.js`
* Test a single CLI test case:

```bash
npx jest path/to/my-test.js
```

* You can also install jest globally and run tests without npx:

```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 ba672a4

Please sign in to comment.