Skip to content

Commit

Permalink
chore: update test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
himharsh1997 committed Aug 18, 2024
1 parent 78e59c9 commit 8def102
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Store files of user",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "mocha --recursive '**/*.spec.js'",
"local": "rm -rf dist && npx tsc && nodemon --watch './**/*.ts' --exec 'ts-node' src/app.ts",
"lint": "npx eslint . --ext .ts",
"lintFix": "eslint --fix",
Expand Down Expand Up @@ -35,12 +35,14 @@
"dotenv": "^16.0.0",
"express": "^4.17.1",
"express-oauth2-jwt-bearer": "^1.1.0",
"mocha": "^10.7.3",
"mongoose": "^6.3.0",
"node-fetch": "^3.2.3",
"request": "^2.88.2"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/mocha": "^10.0.7",
"@types/node": "^17.0.45",
"@types/node-fetch": "^2.6.1",
"@types/request": "^2.48.8",
Expand Down
10 changes: 10 additions & 0 deletions src/test/sample.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import assert from "assert";

describe('Sample test', () => {
it('should calculate number', () => {
const num1 = 1, num2 = 2;
const sum = num1 + num2;
console.log('Actual', sum);
assert.equal(sum, 3);
})
})

0 comments on commit 8def102

Please sign in to comment.