first commit

This commit is contained in:
Rael Calitro 2024-03-27 17:14:09 +01:00
commit c58e016374
11 changed files with 5401 additions and 0 deletions

15
.eslintrc Normal file
View File

@ -0,0 +1,15 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-explicit-any": "error"
}
}

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.DS_Store
node_modules

43
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,43 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Start app",
"request": "launch",
"runtimeArgs": ["run-script", "start"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"sourceMaps": true,
"console": "integratedTerminal"
},
{
"name": "Debug app",
"request": "launch",
"runtimeArgs": ["run-script", "dev", "debug"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"sourceMaps": true,
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# unit-test-template-typescript

7
jest.config.js Normal file
View File

@ -0,0 +1,7 @@
// eslint-disable-next-line no-undef
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/src"],
testMatch: ["**/*.test.ts", "**/*.spec.ts"],
};

10
nodemon.json Normal file
View File

@ -0,0 +1,10 @@
{
"watch": [
"src"
],
"ext": "ts",
"ignore": [
"src/**/*.spec.ts"
],
"exec": "ts-node ./src/index.ts"
}

5268
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

30
package.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "unit-test-template-typescript",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"scripts": {
"dev": "nodemon",
"start": "ts-node src/index.ts",
"test": "jest"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.3"
},
"dependencies": {
"nodemon": "^3.1.0",
"reflect-metadata": "^0.2.1",
"ts-node": "^10.9.2",
"tsyringe": "^4.8.0"
}
}

5
src/index.test.ts Normal file
View File

@ -0,0 +1,5 @@
describe("Test", () => {
it("should pass", () => {
expect(true).toBe(true);
});
});

7
src/index.ts Normal file
View File

@ -0,0 +1,7 @@
async function start() {
console.log("Application starts...");
console.log("Application ends...");
}
start();

13
tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "./dist",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts"]
}