Skip to content

Commit 3453780

Browse files
authored
Add package.json script names from slack discussion (#69)
1 parent e2fffbb commit 3453780

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

package-json-script-names.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# `package.json` Script Names
2+
3+
## General
4+
5+
- `npm run validate`: Runs all tests, type checks, linters, and formatters
6+
7+
## Testing
8+
9+
- `npm run test`: Runs all test runners (Jest and/or Cypress)
10+
- `npm run test:watch`: Runs all test runners in watch mode
11+
- `npm run test:jest`: Runs Jest and exits
12+
- `npm run test:jest:watch`: Runs Jest in watch mode
13+
- `npm run test:cypress`: Runs Cypress and exits
14+
- `npm run test:cypress:open`: Open Cypress dashboard
15+
16+
## Linting
17+
18+
- `npm run lint`: Runs all linters and formatters, and fixes any auto-fixable problems
19+
- `npm run lint:check`: Runs all linters and formatters, and reports problems even if they are auto-fixable
20+
- `npm run lint:js`
21+
- `npm run lint:js:check`
22+
- `npm run lint:css`
23+
- `npm run lint:css:check`
24+
25+
## Type Checking
26+
27+
- `npm run type`: Runs typechecker
28+
- `npm run type:watch`: Runs the typechecker in watch mode

testing/README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
## Best Practices & Standardization
1212

1313
### General
14-
* Organization of `scripts` in package.json:
15-
- `test` = runs all unit/integration/E2E tests in headless mode
16-
- `test:watch` = same as `test` but with Jest in watch mode
17-
- `cypress` = run Cypress with the [Cypress Test Runner](https://docs.cypress.io/guides/guides/command-line.html#cypress-open)
18-
- `check-lint` = runs style lint, eslint, prettier
19-
- `lint` = same as `check-lint` but writes the changes (`--fix`)
20-
- `ci` = run EVERYTHING
14+
* Organization of testing scripts in `package.json` ([more details](../package-json-script-names.md))
15+
* `npm run test`: Runs all test runners (Jest and/or Cypress)
16+
* `npm run test:watch`: Runs all test runners in watch mode
17+
* `npm run test:jest`: Runs Jest and exits
18+
* `npm run test:jest:watch`: Runs Jest in watch mode
19+
* `npm run test:cypress`: Runs Cypress and exits
20+
* `npm run test:cypress:open`: Open Cypress dashboard
21+
2122
* [Apply the AHA principle](https://kentcdodds.com/blog/avoid-nesting-when-youre-testing). Try to minimize nesting, coupling and over-abstraction. These make tests brittle and hard to maintain.
2223

2324
### Jest

0 commit comments

Comments
 (0)