Skip to content

Commit

Permalink
Quieter test install and more typings
Browse files Browse the repository at this point in the history
  • Loading branch information
rianadon committed Jul 7, 2021
1 parent d196999 commit 3f645d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Test Webkit
run: |
sudo apt-get install libegl1 libopus0 libwoff1 libharfbuzz-icu0 gstreamer1.0-plugins-base libgstreamer-gl1.0-0 gstreamer1.0-plugins-bad libopenjp2-7 libwebpdemux2 libenchant1c2a libhyphen0 libgles2 gstreamer1.0-libav
sudo apt-get -qq install libegl1 libopus0 libwoff1 libharfbuzz-icu0 gstreamer1.0-plugins-base libgstreamer-gl1.0-0 gstreamer1.0-plugins-bad libopenjp2-7 libwebpdemux2 libenchant1c2a libhyphen0 libgles2 gstreamer1.0-libav
BROWSER=webkit npm run test
- name: Upload artifact
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^26.0.23",
"@types/jest-image-snapshot": "^4.3.0",
"hass-taste-test": "^0.0.7",
"hass-taste-test": "^0.0.8",
"jest": "^27.0.6",
"jest-image-snapshot": "^4.5.1",
"playwright": "^1.12.3",
Expand Down
6 changes: 3 additions & 3 deletions test/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { durationToSeconds } from "custom-card-helpers";
import { HomeAssistant, PlaywrightElement } from "hass-taste-test";
import { HomeAssistant, HassCard, PlaywrightElement } from "hass-taste-test";
import { entitiesColl } from "home-assistant-js-websocket";
import { toMatchImageSnapshot } from "jest-image-snapshot";
import { toMatchSnapshot } from "jest-snapshot";
Expand All @@ -15,7 +15,7 @@ export async function getEntity(hass: HomeAssistant<any>, entity_id: string) {
}

/** Wait for a timer to reach the time specified. */
export async function waitForTimerTime(card: any, time: string) {
export async function waitForTimerTime(card: HassCard<any>, time: string) {
const element: PlaywrightElement = await card.element();
const textContent = await element.$(".text-content");
const frame = await element.ownerFrame();
Expand Down Expand Up @@ -51,7 +51,7 @@ export async function synchronizeTimerPaused(hass: HomeAssistant<any>, entity_id
}

/** Match both html and image snapshot */
export async function toMatchDualSnapshot(this: any, received: any, name?: string) {
export async function toMatchDualSnapshot(this: any, received: HassCard<any>, name?: string) {
const html = await received.html({ ignoreAttributes: ["style"] });
const htmlResult = toMatchSnapshot.call(this, html, name);

Expand Down

0 comments on commit 3f645d9

Please sign in to comment.