refactor: lint cleanups and helpers

This commit is contained in:
Peter Steinberger
2025-12-23 00:28:40 +00:00
parent f5837dff9c
commit 918cbdcf03
39 changed files with 679 additions and 338 deletions

View File

@@ -2,7 +2,7 @@ import { createServer } from "node:http";
import { afterEach, describe, expect, it } from "vitest";
import { WebSocketServer } from "ws";
import { rawDataToString } from "../infra/ws.js";
import { createTargetViaCdp, evaluateJavaScript, snapshotAria } from "./cdp.js";
describe("cdp", () => {
@@ -29,7 +29,7 @@ describe("cdp", () => {
wsServer.on("connection", (socket) => {
socket.on("message", (data) => {
const msg = JSON.parse(String(data)) as {
const msg = JSON.parse(rawDataToString(data)) as {
id?: number;
method?: string;
params?: { url?: string };
@@ -78,7 +78,7 @@ describe("cdp", () => {
wsServer.on("connection", (socket) => {
socket.on("message", (data) => {
const msg = JSON.parse(String(data)) as {
const msg = JSON.parse(rawDataToString(data)) as {
id?: number;
method?: string;
params?: { expression?: string };
@@ -115,7 +115,7 @@ describe("cdp", () => {
wsServer.on("connection", (socket) => {
socket.on("message", (data) => {
const msg = JSON.parse(String(data)) as {
const msg = JSON.parse(rawDataToString(data)) as {
id?: number;
method?: string;
};