Skip to content
Merged
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
61 changes: 30 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@digital-alchemy/hass",
"repository": "https://github.com/Digital-Alchemy-TS/hass",
"homepage": "https://docs.digital-alchemy.app",
"version": "26.6.13",
"version": "26.8.18",
"description": "Typescript APIs for Home Assistant. Includes rest & websocket bindings",
"scripts": {
"build": "rm -rf dist/; tsc",
Expand Down Expand Up @@ -59,54 +59,53 @@
"license": "MIT",
"devDependencies": {
"@cspell/eslint-plugin": "^10.0.1",
"@digital-alchemy/core": "^26.5.30",
"@digital-alchemy/core": "^26.6.21",
"@digital-alchemy/synapse": "^26.2.6",
"@digital-alchemy/type-writer": "^26.2.12",
"@digital-alchemy/type-writer": "^26.2.13",
"@eslint/compat": "^2.1.0",
"@eslint/eslintrc": "^3.3.5",
"@eslint/eslintrc": "^3.3.6",
"@eslint/js": "^10.0.1",
"@faker-js/faker": "^10.4.0",
"@faker-js/faker": "^10.6.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^25.9.3",
"@types/node": "^26.2.0",
"@types/node-cron": "^3.0.11",
"@types/semver": "^7.7.1",
"@types/semver": "^7.8.0",
"@types/ws": "^8.18.1",
"@typescript-eslint/eslint-plugin": "8.61.0",
"@typescript-eslint/parser": "8.61.0",
"@vitest/coverage-v8": "^4.1.8",
"@vitest/ui": "4.1.8",
"dayjs": "^1.11.21",
"@typescript-eslint/eslint-plugin": "8.67.0",
"@typescript-eslint/parser": "8.67.0",
"@vitest/coverage-v8": "^4.1.10",
"@vitest/ui": "4.1.10",
"dotenv": "^17.4.2",
"eslint": "10.5.0",
"eslint": "10.8.1",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsonc": "^3.2.0",
"eslint-plugin-jsonc": "^3.4.1",
"eslint-plugin-no-unsanitized": "^4.1.5",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-security": "^4.0.1",
"eslint-plugin-simple-import-sort": "^13.0.0",
"eslint-plugin-sonarjs": "^4.0.3",
"eslint-plugin-simple-import-sort": "^14.0.0",
"eslint-plugin-sonarjs": "^4.2.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-unicorn": "^65.0.1",
"node-cron": "^4.2.1",
"npm-check-updates": "^22.2.3",
"prettier": "^3.8.4",
"semver": "^7.8.4",
"tsx": "^4.22.4",
"eslint-plugin-unicorn": "^73.0.0",
"node-cron": "^4.6.0",
"npm-check-updates": "^23.0.2",
"prettier": "^3.9.6",
"semver": "^7.8.5",
"tsx": "^4.23.12",
"typescript": "^6.0.3",
"uuid": "^14.0.0",
"vitest": "^4.1.8",
"ws": "^8.21.0"
"uuid": "^14.0.1",
"vitest": "^4.1.10",
"ws": "^8.21.3"
},
"peerDependencies": {
"@digital-alchemy/core": "*"
},
"dependencies": {
"dayjs": "^1.11.21",
"semver": "^7.8.4",
"type-fest": "^5.7.0",
"uuid": "^14.0.0",
"ws": "^8.21.0"
"dayjs": "^1.11.22",
"semver": "^7.8.5",
"type-fest": "^5.8.0",
"uuid": "^14.0.1",
"ws": "^8.21.3"
},
"packageManager": "yarn@4.11.0"
"packageManager": "yarn@4.18.0"
}
8 changes: 5 additions & 3 deletions src/mock_assistant/mock-assistant.module.mts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ declare module "@digital-alchemy/core" {
*
* Make your own
*/
// mock services monkey-patch constructed hass services, so hass must wire first;
// building from LIB_MOCK_ASSISTANT (depends: hass) guarantees that order, while
// appendLibrary() would wire the mocks before hass
export const createTestRunner = () =>
createModule
.fromLibrary(LIB_HASS)
.fromLibrary(LIB_MOCK_ASSISTANT)
.extend()
.toTest()
.configure({
Expand All @@ -91,7 +94,6 @@ export const createTestRunner = () =>
env: false,
file: false,
},
})
.appendLibrary(LIB_MOCK_ASSISTANT);
});

export const hassTestRunner = createTestRunner();
14 changes: 0 additions & 14 deletions src/testing/backup.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ describe("Backup", () => {
});
});

it("should use the sign path to download", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
lifecycle.onReady(async () => {
const path = "/test/thing";
const destination = "/foo/bar";
vi.spyOn(hass.socket, "sendMessage").mockImplementation(async () => ({ path }));
const spy = vi.spyOn(hass.fetch, "download").mockImplementation(async () => undefined);
await hass.backup.download("test", destination);
expect(spy).toHaveBeenCalledWith(destination, expect.objectContaining({ url: path }));
});
});
});

it("should not start a new backup if one is already in progress", async () => {
expect.assertions(1);
await hassTestRunner.configure({ hass: { RETRY_INTERVAL: 0 } }).run(({ lifecycle, hass }) => {
Expand Down
1 change: 1 addition & 0 deletions src/testing/entity.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("Entity", () => {

describe("API", () => {
describe("Updates", () => {
// relies on real-clock sleeps for the debounce window; too flaky to keep enabled
it.skip("should debounce updates properly", async () => {
expect.assertions(1);
await new Promise<void>(async done => {
Expand Down
1 change: 1 addition & 0 deletions src/testing/workflow.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ describe("Workflows", () => {
});
});

// fake-timer scheduling assertions are unreliable in this suite
describe.skip("Timers", () => {
beforeEach(() => {
vi.useFakeTimers();
Expand Down
Loading
Loading