Skip to content

Commit 5404b45

Browse files
committed
RDBC-867 proper context cleanup
1 parent 392d01f commit 5404b45

File tree

15 files changed

+42
-42
lines changed

15 files changed

+42
-42
lines changed

src/Utility/DateUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class DateUtil {
3535
}
3636

3737
dateString = DateUtil.alignPrecision(dateString);
38-
let parsed;
38+
let parsed: Date;
3939
if (this.opts.useUtcDates || this.opts.withTimezone || dateString.endsWith("Z")) {
4040
parsed = parse(dateString, DateUtil.DEFAULT_DATE_TZ_FORMAT, new Date());
4141
} else {

test/Issues/RDBC-244.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe("RDBC-244", function () {
1717
});
1818

1919
afterEach(async () => {
20+
testContext.customizeStore = null;
2021
await disposeTestDocumentStore(store);
2122
});
2223

test/Issues/RDBC_233.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe("RDBC-233", function () {
2525
const obj = {
2626
date: null,
2727
anotherOne: {
28-
start: "2018-01-02",
29-
end: "2018-01-03"
28+
start: "2018-01-02T12:00:00.000",
29+
end: "2018-01-03T12:00:00.000"
3030
}
3131
};
3232

test/Issues/RDBC_236.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,11 @@ describe("[RDBC-236] Dates storage", function () {
239239
store = await testContext.getDocumentStore();
240240
});
241241

242-
afterEach(function () {
242+
afterEach(async function () {
243243
testContext.customizeStore = null;
244+
await disposeTestDocumentStore(store)
244245
});
245246

246-
afterEach(async () =>
247-
await disposeTestDocumentStore(store));
248-
249247
it("can store & load date", async () => {
250248
const hoursLocal = 13;
251249
const date = new Date(2018, 9, 12, hoursLocal, 10, 10, 0);
@@ -291,13 +289,11 @@ describe("[RDBC-236] Dates storage", function () {
291289
store = await testContext.getDocumentStore();
292290
});
293291

294-
afterEach(function () {
292+
afterEach(async () => {
295293
testContext.customizeStore = null;
294+
await disposeTestDocumentStore(store);
296295
});
297296

298-
afterEach(async () =>
299-
await disposeTestDocumentStore(store));
300-
301297
it("can properly store & load date", async () => {
302298
const hoursLocal = 13;
303299
const date = new Date(2018, 9, 12, hoursLocal, 10, 10, 0);
@@ -346,13 +342,11 @@ describe("[RDBC-236] Dates storage", function () {
346342
store = await testContext.getDocumentStore();
347343
});
348344

349-
afterEach(function () {
345+
afterEach(async function () {
350346
testContext.customizeStore = null;
347+
await disposeTestDocumentStore(store)
351348
});
352349

353-
afterEach(async () =>
354-
await disposeTestDocumentStore(store));
355-
356350
it("can store & load date", async () => {
357351
const hoursLocal = 13;
358352
const date = new Date(2018, 9, 12, hoursLocal, 10, 10, 0);

test/Issues/RDBC_259.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ describe("RDBC-259", function () {
1818
store = await testContext.getDocumentStore();
1919
});
2020

21-
afterEach(async () =>
22-
await disposeTestDocumentStore(store));
21+
afterEach(async () => {
22+
testContext.customizeStore = null;
23+
await disposeTestDocumentStore(store);
24+
});
2325

2426
describe("if you take part (a subobject) of the object A and put into B", function () {
2527

test/Issues/RDBC_404.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ describe("RDBC-404", function () {
1010

1111
beforeEach(async function () {
1212
testContext.customizeStore = async (store) => {
13-
1413
store.conventions.findCollectionNameForObjectLiteral = x => "test";
1514
};
1615
store = await testContext.getDocumentStore();
1716
});
1817

1918
afterEach(async () => {
19+
testContext.customizeStore = null;
2020
await disposeTestDocumentStore(store);
2121
});
2222

test/Ported/Attachments/BulkInsertAttachmentsTest.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ describe("BulkInsertAttachmentsTest", function () {
2323
store = await testContext.getDocumentStore();
2424
});
2525

26-
afterEach(async () =>
27-
await disposeTestDocumentStore(store));
28-
29-
30-
31-
afterEach(() => testContext.customizeStore = null);
26+
afterEach(async () => {
27+
testContext.customizeStore = null;
28+
await disposeTestDocumentStore(store);
29+
});
3230

3331
it("storeManyAttachments1", async () => {
3432
await storeManyAttachments(1, 32 * 1024);

test/Ported/CustomEntityName.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ describe("CustomEntityName", function () {
5656
.hasSize(1);
5757
}
5858
} finally {
59-
await disposeTestDocumentStore(store);
6059
testContext.customizeStore = null;
60+
await disposeTestDocumentStore(store);
6161
}
6262
}
6363

test/Ported/CustomSerializationTest.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ describe("CustomSerializationTest", function () {
5757
});
5858

5959
afterEach(async () => {
60-
await disposeTestDocumentStore(store);
61-
6260
testContext.customizeStore = null;
61+
await disposeTestDocumentStore(store);
6362
});
6463

6564
it("can use custom serialization", async () => {

test/Ported/Faceted/AggregationTest.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ describe("AggregationTest", function () {
6565
store = await testContext.getDocumentStore();
6666
});
6767

68-
afterEach(async () =>
69-
await disposeTestDocumentStore(store));
68+
afterEach(async () => {
69+
testContext.customizeStore = null;
70+
await disposeTestDocumentStore(store);
71+
});
7072

7173
describe("with Orders/All index", () => {
7274

0 commit comments

Comments
 (0)