Compare commits

...

2 commits

Author SHA1 Message Date
Ethan Lane b9035c7338 Setup Jest command
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-01 17:55:10 +00:00
Ethan Lane 2815f6ef12 Install jest 2023-03-01 17:51:41 +00:00
6 changed files with 2299 additions and 175 deletions

View file

@ -1 +1,5 @@
app.ts app.ts
tests/
jest.config.cjs
jest.setup.js

4
jest.config.cjs Normal file
View file

@ -0,0 +1,4 @@
module.exports = {
preset: "ts-jest",
setupFiles: [ "./jest.setup.js" ]
}

3
jest.setup.js Normal file
View file

@ -0,0 +1,3 @@
jest.setTimeout(1 * 1000); // 1 second
jest.resetModules();
jest.resetAllMocks();

View file

@ -23,8 +23,8 @@
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"start": "ts-node app.ts", "start": "ts-node app.ts",
"test": "echo none", "test": "jest",
"lint": "eslint ." "lint": "eslint"
}, },
"bugs": { "bugs": {
"url": "https://gitea.vylpes.xyz/RabbitLabs/random-bunny/issues", "url": "https://gitea.vylpes.xyz/RabbitLabs/random-bunny/issues",
@ -33,8 +33,16 @@
"homepage": "https://gitea.vylpes.xyz/RabbitLabs/random-bunny", "homepage": "https://gitea.vylpes.xyz/RabbitLabs/random-bunny",
"funding": "https://ko-fi.com/vylpes", "funding": "https://ko-fi.com/vylpes",
"devDependencies": { "devDependencies": {
"@types/eslint": "^8.21.1",
"@types/jest": "^29.4.0",
"@types/node": "^18.0.0", "@types/node": "^18.0.0",
"eslint": "^7.17.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"eslint": "^8.35.0",
"jest": "^29.4.3",
"jest-mock-extended": "^3.0.3",
"ts-jest": "^29.0.5",
"ts-mockito": "^2.6.1",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^4.9.5" "typescript": "^4.9.5"
}, },

View file

@ -73,7 +73,9 @@
"./src", "./src",
], ],
"exclude": [ "exclude": [
"./tests" "./tests",
"jest.config.cjs",
"jest.setup.js"
], ],
"ts-node": { "ts-node": {
"esm": true "esm": true

2443
yarn.lock

File diff suppressed because it is too large Load diff