build(tests): Adds jest to run tests

Milestone: none
Signed-off-by: Alix von Schirp <github@avonschirp.bootmedia.de>
This commit is contained in:
2025-04-15 11:22:21 +02:00
parent 2106734b88
commit 6a8cf528e3
4 changed files with 2265 additions and 0 deletions

7
jest.config.js Normal file
View File

@@ -0,0 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
testEnvironment: "node",
transform: {
"^.+\.tsx?$": ["ts-jest", {}],
},
};

View File

@@ -29,6 +29,7 @@
"devDependencies": {
"@eslint/js": "^9.22.0",
"@shipgirl/typedoc-plugin-versions": "^0.3.0",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.10",
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.1",
@@ -36,8 +37,10 @@
"finepack": "^2.12.7",
"globals": "^16.0.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^15.4.3",
"prettier": "3.5.3",
"ts-jest": "^29.2.6",
"typedoc": "^0.27.9",
"typedoc-github-theme": "^0.2.1",
"typedoc-plugin-coverage": "^3.4.1",
@@ -60,6 +63,7 @@
"format:check": "prettier --check .",
"lint": "eslint --cache .",
"prepare": "husky",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"private": true,

2243
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

11
tests/index.spec.ts Normal file
View File

@@ -0,0 +1,11 @@
import Pushover from "../src";
test("Pushover is exported", () => {
expect(Pushover).toBeDefined();
expect(Pushover).toBeInstanceOf(Object);
});
test("Pushover has expected functions", () => {
expect(Pushover).toHaveProperty("prototype.constructor");
expect(Pushover).toHaveProperty("prototype.send");
});