Skip to content

Commit 98affc0

Browse files
committed
Add debugging
1 parent 86a74d4 commit 98affc0

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

run/idp-sql/cloud-sql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Knex = require('knex');
1616
const { getCredConfig } = require('./secrets');
1717
const { logger } = require('./logging');
1818

19-
const TABLE = 'votes';
19+
const TABLE = process.env.TABLE || 'votes';
2020
let knex, credConfig;
2121

2222
// Connection pooling config

run/idp-sql/middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const authenticateJWT = (req, res, next) => {
2828
req.uid = uid;
2929
next();
3030
}).catch((err) => {
31-
logger.error({mesage: `Error with authentication: ${err}`, traceId: req.traceId});
31+
logger.error({message: `Error with authentication: ${err}`, traceId: req.traceId});
3232
return res.sendStatus(403);
3333
});
3434
} else {

run/idp-sql/test/app.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ let request;
2323

2424
describe('Unit Tests', () => {
2525
before(async () => {
26-
const app = require(path.join(__dirname, '..', 'app'));
27-
request = supertest(app);
2826
try {
27+
process.env.TABLE = "votes_dev"
28+
console.log("Creating table...");
2929
await createTable();
3030
} catch(err) {
3131
console.log(`Error creating DB table: ${err}`)
3232
}
33+
const app = require(path.join(__dirname, '..', 'app'));
34+
request = supertest(app);
3335
});
3436

3537
after(async () => {
3638
try {
39+
console.log("Dropping table...");
3740
await dropTable();
3841
} catch(err) {
3942
console.log(`Error dropping DB table: ${err}`)

0 commit comments

Comments
 (0)