Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s1hofmann committed Feb 11, 2024
1 parent d7dfc49 commit 2b0abeb
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
collectCoverageFrom: [
"index.ts",
"lib/**/*.ts",
"!lib/**/*.spec.ts",
"!<rootDir>/node_modules/",
],
preset: "ts-jest",
testEnvironment: "node",
testMatch: process.env.E2E_TEST
? [
"**/__tests__/(e2e)/**/*.[jt]s?(x)",
"**/?(*.)(e2e.)+(spec|test).[jt]s?(x)",
]
: [
"**/__tests__/!(e2e)/**/*.[jt]s?(x)",
"**/!(*.e2e.*)+(spec|test).[jt]s?(x)",
],
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
};
4 changes: 2 additions & 2 deletions lib/libnut-keyboard.class.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import libnut = require("@nut-tree/libnut");
import {libnut} from "../import_libnut";
import {Key} from "@nut-tree/nut-js";
import KeyboardAction from "./libnut-keyboard.class";

jest.mock("@nut-tree/libnut");
jest.mock("../import_libnut");

beforeEach(() => {
jest.resetAllMocks();
Expand Down
4 changes: 2 additions & 2 deletions lib/libnut-mouse.class.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import libnut = require("@nut-tree/libnut");
import {libnut} from "../import_libnut";
import {Button, Point} from "@nut-tree/nut-js";
import MouseAction from "./libnut-mouse.class";

jest.mock("@nut-tree/libnut");
jest.mock("../import_libnut");

beforeEach(() => {
jest.resetAllMocks();
Expand Down
4 changes: 2 additions & 2 deletions lib/libnut-screen.class.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import libnut = require("@nut-tree/libnut");
import {libnut} from "../import_libnut";
import {Region} from "@nut-tree/nut-js";
import ScreenAction from "./libnut-screen.class";

jest.mock("jimp", () => {});
jest.mock("@nut-tree/libnut");
jest.mock("../import_libnut");

beforeEach(() => {
jest.resetAllMocks();
Expand Down
4 changes: 2 additions & 2 deletions lib/libnut-window.class.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import libnut = require("@nut-tree/libnut");
import {libnut} from "../import_libnut";
import WindowAction from "./libnut-window.class";
import {Region} from "@nut-tree/nut-js";

jest.mock("@nut-tree/libnut");
jest.mock("../import_libnut");

beforeEach(() => {
jest.resetAllMocks();
Expand Down

0 comments on commit 2b0abeb

Please sign in to comment.