Browse Source

feat(config.yml): Add lint and test jobs

I had setup two new jobs:
-A lint step that does a yarn lint and a yarn format: check command
-A unit test step that does a yarn test: ci command
test
sipe-daniel 6 years ago
parent
commit
67f97cb25c
  1. 31
      .circleci/config.yml
  2. 4
      package.json

31
.circleci/config.yml

@ -4,6 +4,13 @@ workflows:
build_and_test:
jobs:
- build
- lint:
requires
- build
- test:
requires
- build
jobs:
build:
docker:
@ -25,3 +32,27 @@ jobs:
key: npm-v1-dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
lint:
docker:
- image: cimg/node:14.10.1
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- npm-v1-dependencies-{{ checksum "yarn.lock" }}
- run:
name: "Lint Code"
command: yarn lint && yarn format:check
test:
docker:
- image: cimg/node:14.10.1
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- npm-v1-dependencies-{{ checksum "yarn.lock" }}
- run:
name: "Unit Test"
command: yarn test:ci

4
package.json

@ -20,8 +20,8 @@
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"./**/*.{yaml,yml}\"",
"format:check": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"./**/*.{yaml,yml}\"",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format:check": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\"",
"generate": "hygen"
},
"dependencies": {

Loading…
Cancel
Save