Skip to content

Commit 2e3704f

Browse files
authored
Merge pull request #508 from M4xymm/v6.0
v6.0 tests fixes
2 parents c20c0fc + 86bd7e9 commit 2e3704f

2 files changed

Lines changed: 10 additions & 24 deletions

File tree

test/Ported/HttpsTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ async function extractCertificate(certificateRawData: CertificateRawData) {
280280
if (entry.path.endsWith(".crt")) {
281281
const entryText = await readToEnd(entry);
282282
const lines = entryText.split(/\r?\n/);
283-
cert = lines.slice(1, - 2).join("\r\n");
283+
cert = lines.slice(1, -1).join("\r\n");
284284
break;
285285
} else {
286286
entry.autodrain();

test/Ported/UniqueValuesTest.ts

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -156,33 +156,19 @@ describe("UniqueValuesTest", function () {
156156
assert.strictEqual(readValue.value, "Karmel");
157157
});
158158

159-
it("tryingToDeleteNonExistingKeyShouldNotThrow", async () => {
160-
const res1= await store.operations.send(
159+
it("tryingToDeleteNonExistingKeyShouldThrow", async () => {
160+
const res1 = await store.operations.send(
161161
new PutCompareExchangeValueOperation<string>("key/1", "Name", 0));
162162

163163
assert.strictEqual(res1.value, "Name");
164164
assert.ok(res1.successful);
165-
166-
const res2 = await store.operations.send(
167-
new DeleteCompareExchangeValueOperation<string>("key/2", res1.index));
168-
169-
assert.ok(res2.successful);
170-
assert.equal(res2.value, null);
171-
assert.equal(res2.index, res1.index + 1);
172-
173-
const res3 = await store.operations.send(
174-
new DeleteCompareExchangeValueOperation<string>("key/2", 0));
175-
176-
assert.ok(res3.successful);
177-
assert.equal(res3.value, null);
178-
assert.equal(res3.index, res2.index + 1);
179-
180-
const res4 = await store.operations.send(
181-
new DeleteCompareExchangeValueOperation<string>("key/2", 999));
182-
183-
assert.ok(res4.successful);
184-
assert.equal(res4.value, null);
185-
assert.equal(res4.index, res3.index + 1);
165+
try {
166+
await store.operations.send(
167+
new DeleteCompareExchangeValueOperation<string>("key/2", 0));
168+
assert.fail("should have thrown");
169+
} catch (e) {
170+
assert.strictEqual(e.name, "RavenException")
171+
}
186172
});
187173

188174
it("returnCurrentValueWhenPuttingConcurrently", async () => {

0 commit comments

Comments
 (0)