UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Verified Commit 799a5f01 authored by Douglas Lagemann's avatar Douglas Lagemann
Browse files

Add jest config for coverage, unit tests for stubs to get coverage to 100

parent b5c5b4bb
No related branches found
No related tags found
1 merge request!5BULL-3221: express mvp
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
......@@ -8,7 +8,7 @@
"dev": "node src/server.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test:unit": "jest --coverage"
"test:unit": "jest"
},
"dependencies": {
"express": "^4.21.1",
......@@ -20,5 +20,17 @@
"globals": "^15.11.0",
"jest": "^29.7.0",
"supertest": "^7.0.0"
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"**/*.js",
"!**/*.spec.js",
"!**/node_modules/**",
"!src/server.js",
"!coverage/**"
],
"coverageReporters": ["html", "text-summary", "lcov"],
"coverageDirectory": "coverage"
}
}
const { getDbVersion, healthCheck, runMigrations } = require('../data/dataLayer');
describe('Data', () => {
describe('runMigrations', () => {
it('is a stub', async () => {
await runMigrations();
});
});
describe('healthCheck', () => {
it('returns the stubbed out data', async () => {
const result = await healthCheck();
expect(result).toEqual({
healthy: true,
message: "Health check succeeded, but no database is deployed"
});
});
});
describe('getDbVersion', () => {
it('returns the stubbed out data', async () => {
const result = await getDbVersion();
expect(result).toEqual("no database deployed");
});
});
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment