1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 22:59:28 +00:00

Added new helper class to make insertion of dates easier into test data

This commit is contained in:
2022-02-24 23:04:59 +00:00
parent 4a7b642b29
commit 5875d7bf1b

View File

@@ -9,6 +9,18 @@ const path = require('path');
const DatabaseConnectionPool =
require(path.join(__dirname, '../../lib/DatabaseConnectionPool'));
// Class for easy insertion of test dates into the database
class mySQLDate extends Date {
toString() {
return this.toISOString().slice(0, 19).replace('T', ' ');
}
alterDays(amount) {
this.setDate(this.getDate() + amount);
return this;
}
}
// Object storing configurations for the db tables
const tableDetails = {
parent: {