From d3f49bfe7fe2adce453314a07de6347d8a091a7c Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 4 Apr 2022 11:50:14 -0400 Subject: [PATCH] Simplify YARN commands --- .gitlab-ci.yml | 6 +++--- README.md | 10 +++++----- docs/development/yarn-commands.md | 10 +++++----- package.json | 11 ++++++----- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1550dca2..546e3810e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ before_script: lint-js: stage: lint - script: yarn test:lint:js + script: yarn lint:js only: changes: - "**/*.js" @@ -34,7 +34,7 @@ lint-js: lint-sass: stage: lint - script: yarn test:lint:sass + script: yarn lint:sass only: changes: - "**/*.scss" @@ -43,7 +43,7 @@ lint-sass: jest: stage: test - script: yarn test:jest + script: yarn test:coverage only: changes: - "**/*.js" diff --git a/README.md b/README.md index 6068126d3..4c50d9abe 100644 --- a/README.md +++ b/README.md @@ -153,15 +153,15 @@ NODE_ENV=development - `yarn manage:translations` - Normalizes translation files. Should always be run after editing i18n strings. #### Tests -- `yarn test` - Runs all tests. +- `yarn test:all` - Runs all tests and linters. -- `yarn test:lint` - Runs all linter tests. +- `yarn test` - Runs Jest for frontend unit tests. -- `yarn test:lint:js` - Runs only JavaScript linter. +- `yarn lint` - Runs all linters. -- `yarn test:lint:sass` - Runs only SASS linter. +- `yarn lint:js` - Runs only JavaScript linter. -- `yarn test:jest` - Frontend unit tests. +- `yarn lint:sass` - Runs only SASS linter. # Contributing diff --git a/docs/development/yarn-commands.md b/docs/development/yarn-commands.md index f010d202c..f03b8e073 100644 --- a/docs/development/yarn-commands.md +++ b/docs/development/yarn-commands.md @@ -18,12 +18,12 @@ NODE_ENV=development - `yarn manage:translations` - Normalizes translation files. Should always be run after editing i18n strings. ## Tests -- `yarn test` - Runs all tests. +- `yarn test:all` - Runs all tests and linters. -- `yarn test:lint` - Runs all linter tests. +- `yarn test` - Runs Jest for frontend unit tests. -- `yarn test:lint:js` - Runs only JavaScript linter. +- `yarn lint` - Runs all linters. -- `yarn test:lint:sass` - Runs only SASS linter. +- `yarn lint:js` - Runs only JavaScript linter. -- `yarn test:jest` - Frontend unit tests. +- `yarn lint:sass` - Runs only SASS linter. diff --git a/package.json b/package.json index a63867743..da201c5b4 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,12 @@ "build": "npx webpack", "jsdoc": "npx jsdoc -c jsdoc.conf.js", "manage:translations": "node ./webpack/translationRunner.js", - "test": "${npm_execpath} run test:lint && ${npm_execpath} run test:jest", - "test:lint": "${npm_execpath} run test:lint:js && ${npm_execpath} run test:lint:sass", - "test:lint:js": "npx eslint --ext .js,.jsx,.ts,.tsx . --cache", - "test:lint:sass": "npx stylelint app/styles/**/*.scss", - "test:jest": "npx jest --coverage", + "test": "npx jest", + "test:coverage": "npx jest --coverage", + "test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint", + "lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass", + "lint:js": "npx eslint --ext .js,.jsx,.ts,.tsx . --cache", + "lint:sass": "npx stylelint app/styles/**/*.scss", "prepare": "husky install" }, "license": "AGPL-3.0-or-later",