Merge pull request #272 from nut-tree/maintenance/271/dependency_updates

Maintenance/271/dependency updates
This commit is contained in:
Simon Hofmann
2021-09-05 23:22:29 +02:00
committed by GitHub
9 changed files with 2285 additions and 3348 deletions
+5 -5
View File
@@ -42,11 +42,11 @@ jobs:
run: |
npm run coverage:merge
npm run coverage:merge-report
- name: Send results to SonarCloud
uses: SonarSource/sonarcloud-github-action@v1.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: Send results to SonarCloud
# uses: SonarSource/sonarcloud-github-action@v1.6
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
needs:
+2 -3
View File
@@ -12,6 +12,8 @@ import {
straightTo,
} from "./index";
jest.setTimeout(60000);
const openXfceMenu = async () => {
await mouse.move(straightTo(centerOf(screen.find("menu.png"))));
await mouse.leftClick();
@@ -47,12 +49,10 @@ describe("E2E tests", () => {
});
it("should throw on invalid images", async () => {
jest.setTimeout(30000);
await expect(screen.find("mouse.png")).rejects.toContain("Failed to load image");
});
it("should perform some calculations", async () => {
jest.setTimeout(30000);
screen.config.resourceDirectory = "./e2e/assets";
await assert.isVisible("mouse.png");
await assert.isVisible("desktop.png");
@@ -67,7 +67,6 @@ describe("E2E tests", () => {
});
it("drag & drop", async () => {
jest.setTimeout(60000);
screen.config.resourceDirectory = "./e2e/assets";
const expected = new Region(38, 585, 70, 86);
+1 -1
View File
@@ -1,5 +1,6 @@
import { jestMatchers, Key, keyboard, screen } from "../index";
jest.setTimeout(30000);
expect.extend(jestMatchers);
const run = async (cmd: string) => {
@@ -19,7 +20,6 @@ const close = async () => {
describe("Keyboard e2e class", () => {
it("should open gnome calculator via keyboard.", async () => {
// GIVEN
jest.setTimeout(30000);
screen.config.resourceDirectory = "./e2e/assets";
screen.config.confidence = 0.97;
await run("gnome-calculator");
+1 -1
View File
@@ -3,6 +3,7 @@ import { Key } from "./key.enum";
import { Keyboard } from "./keyboard.class";
jest.mock("./adapter/native.adapter.class");
jest.setTimeout(10000);
beforeEach(() => {
jest.resetAllMocks();
@@ -38,7 +39,6 @@ describe("Keyboard", () => {
it("should pass multiple input strings down to the type call.", async () => {
// GIVEN
jest.setTimeout(10000);
const adapterMock = new NativeAdapter();
const SUT = new Keyboard(adapterMock);
const payload = ["Test input!", "Array test2"];
@@ -6,7 +6,7 @@ beforeEach(() => {
describe("clipboardy action", () => {
describe("copy", () => {
it("should resolve", async done => {
it("should resolve", async () => {
// GIVEN
const SUT = new ClipboardAction();
const testText = "test";
@@ -15,11 +15,10 @@ describe("clipboardy action", () => {
// THEN
await SUT.copy(testText);
done();
});
});
describe("hasText", () => {
it("should return true when text has been copied", async done => {
it("should return true when text has been copied", async () => {
// GIVEN
const SUT = new ClipboardAction();
const testText = "test";
@@ -29,7 +28,6 @@ describe("clipboardy action", () => {
// THEN
await expect(SUT.hasText()).resolves.toBeTruthy();
done();
});
});
});
+2 -2
View File
@@ -5,6 +5,8 @@ import {Screen} from "./screen.class";
import {sleep} from "./sleep.function";
import AbortController from "node-abort-controller";
jest.setTimeout(10000);
describe("Screen.", () => {
it("should capture the screen", () => {
// GIVEN
@@ -91,7 +93,6 @@ describe("Screen.", () => {
it("should reject after timeout", async () => {
// GIVEN
jest.setTimeout(10000);
const timeout = 5000;
const visionAdapter = new VisionAdapter();
const SUT = new Screen(visionAdapter);
@@ -113,7 +114,6 @@ describe("Screen.", () => {
it("should abort via signal", (done) => {
// GIVEN
jest.setTimeout(10000);
const timeout = 5000;
const abortAfterMs = 1000;
const controller = new AbortController();
+4 -5
View File
@@ -1,5 +1,6 @@
import {timeout} from "./timeout.function";
import AbortController from "node-abort-controller";
import {sleep} from "../sleep.function";
describe("timeout", () => {
it("should timeout after maxDuration if action rejects", async () => {
@@ -138,7 +139,7 @@ describe("timeout", () => {
expect(action).toBeCalledTimes(1);
});
it("should fail after timeout if no result is returned from long running action", async (done) => {
it("should fail after timeout if no result is returned from long running action", async () => {
// GIVEN
const updateInterval = 100;
const maxDuration = 200;
@@ -156,10 +157,8 @@ describe("timeout", () => {
// THEN
await expect(SUT).rejects.toBe(`Action timed out after ${maxDuration} ms`);
expect(action).toBeCalledTimes(1);
setTimeout(() => {
expect(action).toBeCalledTimes(1);
done();
}, 500);
await sleep(500);
expect(action).toBeCalledTimes(1);
});
it("should be externally abortable", async () => {
+2261 -3318
View File
File diff suppressed because it is too large Load Diff
+7 -9
View File
@@ -52,7 +52,6 @@
"coverage:clean": "rimraf coverage",
"coverage:merge": "istanbul-merge --out coverage/merged/coverage-final.json ./coverage/unit/coverage-final.json ./coverage/e2e/coverage-final.json",
"coverage:merge-report": "nyc report --reporter=lcov --reporter=text --temp-dir=./coverage/merged --report-dir=./coverage/merged",
"lint": "tslint -p tsconfig.json",
"watch": "tsc -w -p .",
"publish-next": "npm publish --tag next",
"prepublishOnly": "npm run compile",
@@ -61,23 +60,22 @@
},
"dependencies": {
"@nut-tree/libnut": "2.1.2",
"clipboardy": "2.0.0",
"clipboardy": "2.3.0",
"node-abort-controller": "2.0.0",
"opencv4nodejs-prebuilt": "5.3.3"
},
"devDependencies": {
"@types/clipboardy": "2.0.1",
"@types/jest": "25.1.4",
"@types/node": "16.7.7",
"@types/jest": "27.0.1",
"@types/node": "16.7.10",
"istanbul-merge": "1.1.1",
"jest": "25.1.0",
"jest": "27.1.0",
"nyc": "15.1.0",
"rimraf": "3.0.2",
"sneer": "1.0.1",
"ts-jest": "25.4.0",
"tslint": "6.1.0",
"typedoc": "0.17.6",
"ts-jest": "27.0.5",
"typedoc": "0.21.9",
"typescript": "4.4.2",
"version-bump-prompt": "6.0.2"
"version-bump-prompt": "6.1.0"
}
}