Skip to content

Commit

Permalink
Start a test suite so the guessing can be test-driven
Browse files Browse the repository at this point in the history
Refs #31
  • Loading branch information
thewilkybarkid committed Jul 9, 2024
1 parent f02513c commit 6e98a7f
Show file tree
Hide file tree
Showing 7 changed files with 1,132 additions and 61 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,28 @@ jobs:
- name: 'Run the linter'
run: npx eslint . --max-warnings 0

test:
name: 'test'
runs-on: ubuntu-22.04
timeout-minutes: 30
if: github.event_name != 'schedule'

steps:
- name: 'Checkout code'
uses: actions/[email protected]

- name: 'Set up Node.js'
uses: actions/[email protected]
with:
node-version-file: package.json
cache: ${{ !env.ACT && 'npm' || '' }}

- name: 'Install dependencies'
run: npm ci

- name: 'Run the tests'
run: npx vitest run

typecheck:
name: 'Typecheck'
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -175,6 +197,7 @@ jobs:
- build-image
- format
- lint
- test
- typecheck

steps:
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build-image check format lint prod start typecheck
.PHONY: build-image check format lint prod start test typecheck

CADDY_PASSWORD=letmein
IMAGE_TAG=prereview-stats
Expand All @@ -19,14 +19,17 @@ build-image: .env node_modules
npx @dotenvx/dotenvx run -- npx observable build
docker build --target prod --tag ${IMAGE_TAG} .

check: format lint typecheck
check: format lint test typecheck

format: node_modules
npx prettier --ignore-unknown --check '**'

lint: node_modules
npx eslint . --max-warnings 0

test: node_modules
npx vitest run

typecheck: node_modules
npx tsc --noEmit

Expand Down
Loading

0 comments on commit 6e98a7f

Please sign in to comment.