Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run Unit Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout Repository 🫠
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm run build
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test -- --coverage --run
- uses: actions/upload-artifact@v3
name: Archive coverage report
with:
name: coverage-report
path: coverage
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:all": "vitest",
"test:accessibility": "vitest accessibility --run",
"coverage": "vitest --coverage --run",
"test": "echo \"Navigate into an example and run the tests from there!\" && exit 1",
"test": "vitest",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import colors from '@/colors.json';
import colors from '@/src/colors.json';
import { css } from '@emotion/css';
import { ComponentPropsWithoutRef } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/polygon.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { beforeEach, describe, it, expect } from 'vitest';
import { createPolygon, Polygon } from 'src/lib/polygon';
import { createPolygon, Polygon } from '$lib/polygon';

type ContextWithPolygon = {
polygon: Polygon;
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
['**/*.component.test.ts', 'jsdom'],
],
coverage: {
statements: 54.92,
statements: 50,
thresholdAutoUpdate: true,
include: ['src/**/*'],
exclude: [
Expand Down