Skip to content

Commit

Permalink
test: add tests for AttributeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-kwitt authored and nurikk committed Jan 26, 2024
1 parent 7f46ad0 commit 20fb3ef
Show file tree
Hide file tree
Showing 17 changed files with 1,592 additions and 77 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,31 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 📥 Checkout Repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
- name: 📦 Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js
- name: 🚀 Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- run: pnpm install --frozen-lockfile
- name: 🛠️ Install Dependencies
run: pnpm install --frozen-lockfile

- name: Check static code analysis.
- name: 🔍 Check static code analysis
run: pnpm run test:eslint

- name: Check code style.
- name: 💅 Check code style
run: pnpm run test:pretty

- run: pnpm build

- name: 🧪 Run tests
run: pnpm run test:unit

- name: 🏗️ Build production bundle
run: pnpm build
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ Z2M_API_URI="ws://192.168.1.200:8080" npm run start
open http://localhost:3030/
```

# Tests

```bash
npm run test:unit
```

# Build

```bash
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable",
"test:unit": "vitest",
"test:eslint": "eslint \"./src/**/*.{js,jsx,tsx}\"",
"test:pretty": "prettier --check \"./**/*.{js,jsx,tsx}\""
},
Expand All @@ -36,7 +37,9 @@
"@fortawesome/fontawesome-free": "~6.4.2",
"@rjsf/bootstrap-5": "https://github.com/nurikk/fileshare/blob/main/rjsf-bootstrap-5-4.2.0.tgz?raw=true",
"@rjsf/core": "~4.2.3",
"@toolz/local-storage": "~1.0.5",
"@testing-library/jest-dom": "^6.3.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@types/color-convert": "~2.0.1",
"@types/d3-drag": "~3.0.4",
"@types/d3-force": "~3.0.6",
Expand Down Expand Up @@ -77,6 +80,7 @@
"husky": "~8.0.3",
"i18next": "~23.5.1",
"i18next-browser-languagedetector": "~7.1.0",
"jsdom": "^24.0.0",
"jszip": "~3.10.1",
"lodash": "~4.17.21",
"notyf": "~3.10.0",
Expand All @@ -96,13 +100,15 @@
"react-transition-group": "~4.4.5",
"reconnecting-websocket": "~4.4.0",
"sass": "~1.68.0",
"store2": "^2.14.2",
"timeago.js": "~4.0.2",
"typescript": "~5.2.2",
"unistore": "~3.5.2",
"vite": "~4.4.10",
"vite-plugin-compression": "~0.5.1",
"vite-plugin-html": "~3.2.0",
"vite-plugin-sass-dts": "~1.3.11",
"vitest": "^1.2.1",
"ws": "~8.14.2",
"zigbee-herdsman": "~0.19.0",
"zigbee-herdsman-converters": "~15.87.0"
Expand Down

0 comments on commit 20fb3ef

Please sign in to comment.