Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digital-alchemy-ts/hass-unit-testing-sample
A quick example project to demonstrate the process of creating unit tests for automations
https://github.com/digital-alchemy-ts/hass-unit-testing-sample
digital-alchemy example-code homeassistant homeautomation jest typescript unit-testing
Last synced: about 2 months ago
JSON representation
A quick example project to demonstrate the process of creating unit tests for automations
- Host: GitHub
- URL: https://github.com/digital-alchemy-ts/hass-unit-testing-sample
- Owner: Digital-Alchemy-TS
- License: mit
- Created: 2024-05-03T21:32:29.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-06T20:15:48.000Z (8 months ago)
- Last Synced: 2024-05-07T21:01:09.158Z (8 months ago)
- Topics: digital-alchemy, example-code, homeassistant, homeautomation, jest, typescript, unit-testing
- Language: TypeScript
- Homepage: https://docs.digital-alchemy.app/hass/unit-testing
- Size: 1.29 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 🌐 Overview
Welcome to the Digital Alchemy example unit tests repo.
This code exists as a functional example of implementing unit tests within a nodejs application that works with Home Assistant.You are able to able to run the tests standalone, without connecting to any instance of Home Assistant.
The configuration used to build the code is provided [here](./hass/), so you are able to build on the existing work to create your own mock environment.- [Extended documentation](https://docs.digital-alchemy.app/hass/unit-testing)
- Ask questions on [Discord](https://discord.gg/JkZ35Gv97Y)## 👢 Try it out
The following commands will install dependencies, configure type definitions for the project, and run the tests.
```bash
npm install
cp ./hass/types.d.ts ./node_modules/@digital-alchemy/hass/dist/dynamic.d.ts
npm run test
```![passing tests](/assets/schedule-test.png)