Skip to content

Commit

Permalink
Added tests (paritytech#14)
Browse files Browse the repository at this point in the history
Closes #3 

Created unit test with jest.

Basic default project.

Will be used in upcoming features.
  • Loading branch information
Bullrich authored Jul 11, 2023
1 parent f9319ef commit a235afc
Show file tree
Hide file tree
Showing 4 changed files with 1,521 additions and 20 deletions.
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = { preset: "ts-jest", testEnvironment: "node", testMatch: [__dirname + "/src/**/test/**/*.ts"] };
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "node dist",
"build": "ncc build --license LICENSE",
"test": "echo \"No tests yet\"",
"test": "jest",
"fix": "eslint --fix 'src/**/*'",
"lint": "eslint 'src/**/*'"
},
Expand All @@ -22,7 +22,10 @@
"homepage": "https://github.com/paritytech/review-bot#readme",
"devDependencies": {
"@eng-automation/js-style": "^2.1.0",
"@types/jest": "^29.5.3",
"@vercel/ncc": "^0.36.1",
"jest": "^29.6.1",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test("adds 1 + 2 to equal 3", () => {
expect(1 + 2).toBe(3);
});
Loading

0 comments on commit a235afc

Please sign in to comment.