mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 02:09:18 +02:00
chore: fix eslint errors
This commit is contained in:
parent
fb4507ddc5
commit
1d319929ed
1 changed files with 16 additions and 19 deletions
|
@ -1,11 +1,10 @@
|
|||
import { describe, expect, it } from "@jest/globals";
|
||||
import { PromiseResolver } from "@yume-chan/async";
|
||||
import {
|
||||
ReadableStream,
|
||||
type ReadableStreamDefaultController,
|
||||
WritableStream,
|
||||
} from "@yume-chan/stream-extra";
|
||||
import { type AdbSocket } from "../../../adb.js";
|
||||
import type { ReadableStreamDefaultController } from "@yume-chan/stream-extra";
|
||||
import { ReadableStream, WritableStream } from "@yume-chan/stream-extra";
|
||||
|
||||
import type { AdbSocket } from "../../../adb.js";
|
||||
|
||||
import {
|
||||
AdbShellProtocolId,
|
||||
AdbShellProtocolPacket,
|
||||
|
@ -85,7 +84,7 @@ describe("AdbSubprocessShellProtocol", () => {
|
|||
const stdoutReader = process.stdout.getReader();
|
||||
const stderrReader = process.stderr.getReader();
|
||||
|
||||
stdoutReader.cancel();
|
||||
await stdoutReader.cancel();
|
||||
closed.resolve();
|
||||
|
||||
await expect(stderrReader.read()).resolves.toEqual({
|
||||
|
@ -102,17 +101,15 @@ describe("AdbSubprocessShellProtocol", () => {
|
|||
describe("`socket` close", () => {
|
||||
describe("with `exit` message", () => {
|
||||
it("should close `stdout`, `stderr` and resolve `exit`", async () => {
|
||||
const [socket, closed] = createMockSocket(
|
||||
async (controller) => {
|
||||
controller.enqueue(
|
||||
AdbShellProtocolPacket.serialize({
|
||||
id: AdbShellProtocolId.Exit,
|
||||
data: new Uint8Array([42]),
|
||||
}),
|
||||
);
|
||||
controller.close();
|
||||
},
|
||||
);
|
||||
const [socket, closed] = createMockSocket((controller) => {
|
||||
controller.enqueue(
|
||||
AdbShellProtocolPacket.serialize({
|
||||
id: AdbShellProtocolId.Exit,
|
||||
data: new Uint8Array([42]),
|
||||
}),
|
||||
);
|
||||
controller.close();
|
||||
});
|
||||
|
||||
const process = new AdbSubprocessShellProtocol(socket);
|
||||
const stdoutReader = process.stdout.getReader();
|
||||
|
@ -175,7 +172,7 @@ describe("AdbSubprocessShellProtocol", () => {
|
|||
|
||||
describe("`socket.readable` invalid data", () => {
|
||||
it("should error `stdout`, `stderr` and reject `exit`", async () => {
|
||||
const [socket, closed] = createMockSocket(async (controller) => {
|
||||
const [socket, closed] = createMockSocket((controller) => {
|
||||
controller.enqueue(new Uint8Array([7, 8, 9]));
|
||||
controller.close();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue