Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP App testing #5

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
*/.DS_Store
*/node_modules
*/migrations
*/coverage
.DS_Store
3 changes: 3 additions & 0 deletions app/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
};
13,802 changes: 9,476 additions & 4,326 deletions app/package-lock.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,25 @@
"zod": "3.22.4"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-typescript": "^7.23.3",
"@types/express": "^4.17.13",
"@types/jest": "^29.5.12",
"@types/react": "^18.0.37",
"@types/react-router-dom": "^5.3.3",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"prisma": "4.16.2",
"ts-jest": "^29.1.2",
"typescript": "^5.1.0",
"vite": "^4.3.9"
},
"scripts": {
"test": "jest --verbose"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node"
}
}
4 changes: 4 additions & 0 deletions app/src/test/client/sum_client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function sum(a, b) {
return a + b;
}
module.exports = sum;
5 changes: 5 additions & 0 deletions app/src/test/client/sum_client.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const sum = require('./sum_client');

test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
7 changes: 7 additions & 0 deletions app/src/test/server/sum_server.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {sum} from './sum_server';

describe('sum module', () => {
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
});
5 changes: 5 additions & 0 deletions app/src/test/server/sum_server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// sum.ts
export function sum(a: number, b: number): number {
return a + b;
}