Skip to content

Commit

Permalink
Add typescript template project with a dummy function and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinav Manchanda committed Aug 4, 2021
0 parents commit 82fe778
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node'
}
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "typescript-template",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest",
"build": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/jest": "^26.0.24",
"jest": "^27.0.6",
"ts-jest": "^27.0.4",
"typescript": "^4.3.5"
}
}
3 changes: 3 additions & 0 deletions src/Dummy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const dummyOutput = (input: string) => {
return input + input
}
8 changes: 8 additions & 0 deletions test/src/Dummy.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { dummyOutput } from '../../src/Dummy'

describe("Dummy Test", () => {
it("should assert on the dummy output", () => {
const dummyOutputReturned = dummyOutput("hello")
expect(dummyOutputReturned).toBe("hellohello")
})
})
25 changes: 25 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["es2020"],
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",

"removeComments": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": false
},
"exclude": ["node_modules"],
"include": ["./src/**/*.ts"]
}

0 comments on commit 82fe778

Please sign in to comment.