mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:39:26 +00:00
Added new helper class to make insertion of dates easier into test data
This commit is contained in:
@@ -9,6 +9,18 @@ const path = require('path');
|
|||||||
const DatabaseConnectionPool =
|
const DatabaseConnectionPool =
|
||||||
require(path.join(__dirname, '../../lib/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
|
// Object storing configurations for the db tables
|
||||||
const tableDetails = {
|
const tableDetails = {
|
||||||
parent: {
|
parent: {
|
||||||
|
|||||||
Reference in New Issue
Block a user