Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit b3db76b9 authored by Simon Chan's avatar Simon Chan
Browse files

fix(scrcpy): `options.setListDisplays` not work for some versions

fixes #567
parent 7056feb3
Loading
Loading
Loading
Loading

.prettierrc.yaml

0 → 100644
+2 −0
Original line number Diff line number Diff line
trailingComma: all
tabWidth: 4
+1 −0
Original line number Diff line number Diff line
export * from "./1_16.js";
export * from "./1_22.js";
export * from "./2_0.js";
export * from "./2_1.js";
export * from "./latest.js";
export * from "./types.js";
+2 −2
Original line number Diff line number Diff line
import { AdbScrcpyOptions2_0 } from "./2_0.js";
import { AdbScrcpyOptions2_1 } from "./2_1.js";

export class AdbScrcpyOptionsLatest extends AdbScrcpyOptions2_0 {}
export class AdbScrcpyOptionsLatest extends AdbScrcpyOptions2_1 {}
+8 −0
Original line number Diff line number Diff line
@@ -22,4 +22,12 @@ describe("ScrcpyOptions1_16", () => {
            ]);
        });
    });

    describe("setListDisplays", () => {
        it("should set `display` to `-1`", () => {
            const options = new ScrcpyOptions1_16({});
            options.setListDisplays();
            expect(options.value.displayId).toBe(-1);
        });
    });
});
+26 −0
Original line number Diff line number Diff line
import { describe, expect, it } from "@jest/globals";

import { ScrcpyOptions1_17 } from "./1_17.js";

describe("ScrcpyOptions1_17", () => {
    it("should share `value` with `base`", () => {
        const options = new ScrcpyOptions1_17({});
        expect(options.value).toBe(options["_base"].value);
    });

    describe("setListDisplays", () => {
        it("should set `displayId` to `-1`", () => {
            const options = new ScrcpyOptions1_17({});
            options.setListDisplays();
            expect(options.value.displayId).toBe(-1);
        });
    });

    describe("setListEncoders", () => {
        it("should set `encoderName` to `_`", () => {
            const options = new ScrcpyOptions1_17({});
            options.setListEncoders();
            expect(options.value.encoderName).toBe("_");
        });
    });
});
Loading