mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Update Date.test.ts to use Date objects instead of formatted strings
This commit is contained in:
@@ -32,12 +32,9 @@ describe("DatabaseDate", () => {
|
||||
DatabaseDate.asDateStartOfTheDayEndOfTheDayForDatabaseQuery(
|
||||
inputDate,
|
||||
).toJSON();
|
||||
const expectedStart: string = moment(inputDate)
|
||||
.startOf("day")
|
||||
.format("YYYY-MM-DD HH:mm:ss");
|
||||
const expectedEnd: string = moment(inputDate)
|
||||
.endOf("day")
|
||||
.format("YYYY-MM-DD HH:mm:ss");
|
||||
const expectedStart: Date = moment(inputDate).startOf("day").toDate();
|
||||
const expectedEnd: Date = moment(inputDate).endOf("day").toDate();
|
||||
|
||||
expect(result).toEqual({
|
||||
startValue: expectedStart,
|
||||
endValue: expectedEnd,
|
||||
|
||||
@@ -234,7 +234,6 @@ export default class BaseAnalyticsAPI<
|
||||
let groupBy: GroupBy<AnalyticsDataModel> = {};
|
||||
|
||||
if (req.body) {
|
||||
|
||||
query = JSONFunctions.deserialize(
|
||||
req.body["query"],
|
||||
) as Query<AnalyticsDataModel>;
|
||||
|
||||
Reference in New Issue
Block a user