Skip to content

Commit 852e070

Browse files
committed
RDBC-867 Get rid of moment.js (from tests)
1 parent dcfd20f commit 852e070

19 files changed

+626
-610
lines changed

test/Ported/Core/Commands/Other.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { disposeTestDocumentStore, testContext } from "../../../Utils/TestUtil.js";
88
import { User } from "../../../Assets/Entities.js";
99
import { assertThat } from "../../../Utils/AssertExtensions.js";
10+
import { addMinutes } from "date-fns";
1011

1112
describe("OtherTest", function () {
1213
let store: IDocumentStore;
@@ -32,7 +33,7 @@ describe("OtherTest", function () {
3233
const ts = session.timeSeriesFor(id, "HeartRates");
3334
const cf = session.countersFor(id);
3435
for (let j = 0; j < 20; j++) {
35-
ts.append(baseLine.clone().add(j, "minutes").toDate(), j, "watches/apple");
36+
ts.append(addMinutes(baseLine, j), j, "watches/apple");
3637
cf.increment("Likes", j);
3738
}
3839

test/Ported/Indexing/TimeSeries/BasicTimeSeriesIndexes_JavaScriptTest.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Employee } from "../../../Assets/Orders.js";
99
import { Address, Company, User } from "../../../Assets/Entities.js";
1010
import { assertThat } from "../../../Utils/AssertExtensions.js";
1111
import { RavenTestHelper } from "../../../Utils/RavenTestHelper.js";
12+
import { addHours } from "date-fns";
1213

1314
describe("BasicTimeSeriesIndexes_JavaScript", function () {
1415

@@ -105,7 +106,7 @@ describe("BasicTimeSeriesIndexes_JavaScript", function () {
105106

106107
for (let i = 0; i < 10; i++) {
107108
session.timeSeriesFor(user, "heartRate")
108-
.append(today.clone().add(i, "hours").toDate(), 180 + i, address.id);
109+
.append(addHours(today, i), 180 + i, address.id);
109110
}
110111

111112
await session.saveChanges();
@@ -191,14 +192,14 @@ describe("BasicTimeSeriesIndexes_JavaScript", function () {
191192
await session.store(company);
192193

193194
session.timeSeriesFor(company, "heartRate")
194-
.append(now.toDate(), 2.5, "tag1");
195+
.append(now, 2.5, "tag1");
195196
session.timeSeriesFor(company, "heartRate2")
196-
.append(now.toDate(), 3.5, "tag2");
197+
.append(now, 3.5, "tag2");
197198

198199
const user = new User();
199200
await session.store(user);
200201
session.timeSeriesFor(user, "heartRAte")
201-
.append(now.toDate(), 4.5, "tag3");
202+
.append(now, 4.5, "tag3");
202203

203204
await session.saveChanges();
204205
}
@@ -247,9 +248,9 @@ describe("BasicTimeSeriesIndexes_JavaScript", function () {
247248
const session = store.openSession();
248249
const company = await session.load("companies/1", Company);
249250
session.timeSeriesFor(company, "heartRate")
250-
.append(now.toDate(), 2.5, "tag1");
251+
.append(now, 2.5, "tag1");
251252
session.timeSeriesFor(company, "heartRate2")
252-
.append(now.toDate(), 3.5, "tag2");
253+
.append(now, 3.5, "tag2");
253254

254255
await session.saveChanges();
255256
}

test/Ported/Indexing/TimeSeries/BasicTimeSeriesIndexes_MixedSyntaxTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe("BasicTimeSeriesIndexes_MixedSyntaxTest", function () {
2727
const company = new Company();
2828
await session.store(company, "companies/1");
2929
session.timeSeriesFor(company, "HeartRate")
30-
.append(now1.toDate(), 7, "tag");
30+
.append(now1, 7, "tag");
3131

3232
await session.saveChanges();
3333
}

0 commit comments

Comments
 (0)