@nsshunt/ststestrunner 1.1.164 → 1.1.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ststestrunner.cjs
CHANGED
|
@@ -1554,7 +1554,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
|
|
|
1554
1554
|
this.runner.instrumentData.requestCount++;
|
|
1555
1555
|
const compPersonRecord = { ...personRecord };
|
|
1556
1556
|
const loadedPersonRecorded = { ...retVal.body };
|
|
1557
|
-
const loadedRecordVersion = loadedPersonRecorded.meta.versionId;
|
|
1557
|
+
const loadedRecordVersion = parseInt(loadedPersonRecorded.meta.versionId);
|
|
1558
1558
|
delete compPersonRecord.meta;
|
|
1559
1559
|
delete loadedPersonRecorded.meta;
|
|
1560
1560
|
if (loadedRecordVersion > 1) compPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration % this.GetMaxIteration(prefix)}`;
|
|
@@ -2275,7 +2275,7 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
|
|
|
2275
2275
|
const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
|
|
2276
2276
|
if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
|
|
2277
2277
|
const resource = retVal.body;
|
|
2278
|
-
const loadedRecordVersion = resource.meta.versionId;
|
|
2278
|
+
const loadedRecordVersion = parseInt(resource.meta.versionId);
|
|
2279
2279
|
const patchText = `Json Patched record TestCaseFhir07 ${this.runner.iteration % this.GetMaxIteration(prefix)}`;
|
|
2280
2280
|
const observer = fast_json_patch_default.observe(resource);
|
|
2281
2281
|
resource.text.div = patchText;
|
|
@@ -2285,12 +2285,6 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
|
|
|
2285
2285
|
if (retValPatched.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
|
|
2286
2286
|
const retRecordCheck = { ...retValPatched.body };
|
|
2287
2287
|
personRecord.text.div = patchText;
|
|
2288
|
-
const zz = (loadedRecordVersion + 1).toString();
|
|
2289
|
-
console.log(loadedRecordVersion);
|
|
2290
|
-
console.log(typeof loadedRecordVersion);
|
|
2291
|
-
console.log(typeof (loadedRecordVersion + 1));
|
|
2292
|
-
console.log(typeof zz);
|
|
2293
|
-
console.log(zz);
|
|
2294
2288
|
personRecord.meta.versionId = (loadedRecordVersion + 1).toString();
|
|
2295
2289
|
delete personRecord.meta.lastUpdated;
|
|
2296
2290
|
delete retRecordCheck.meta.lastUpdated;
|
|
@@ -2312,7 +2306,7 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
|
|
|
2312
2306
|
const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
|
|
2313
2307
|
if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
|
|
2314
2308
|
const resource = retVal.body;
|
|
2315
|
-
const loadedRecordVersion = resource.meta.versionId;
|
|
2309
|
+
const loadedRecordVersion = parseInt(resource.meta.versionId);
|
|
2316
2310
|
const patchText = `Merge Patched record TestCaseFhir08 ${this.runner.iteration & this.GetMaxIteration(prefix)}`;
|
|
2317
2311
|
resource.text.div = patchText;
|
|
2318
2312
|
const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"${loadedRecordVersion}"`);
|
|
@@ -2340,29 +2334,36 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
|
|
|
2340
2334
|
const retVal = await client.GetResource("Person", personRecord.id);
|
|
2341
2335
|
const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
|
|
2342
2336
|
if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
const
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
if (
|
|
2362
|
-
|
|
2363
|
-
|
|
2337
|
+
const resource = retVal.body;
|
|
2338
|
+
if (resource.meta) {
|
|
2339
|
+
const loadedRecordVersion = parseInt(resource.meta.versionId);
|
|
2340
|
+
try {
|
|
2341
|
+
const retVal = await client.DeleteResource("Person", personRecord.id, `W/"${loadedRecordVersion}"`);
|
|
2342
|
+
this._CheckOutputLongDurationError(__snapshot4, "await this.DeleteResource()");
|
|
2343
|
+
if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
|
|
2344
|
+
const deletedRetValCheck = {
|
|
2345
|
+
resourceType: "OperationOutcome",
|
|
2346
|
+
issue: [{
|
|
2347
|
+
severity: "error",
|
|
2348
|
+
code: "deleted",
|
|
2349
|
+
diagnostics: `DeleteResource: Resource ${personRecord.id} version ${loadedRecordVersion + 1} has been deleted.`
|
|
2350
|
+
}]
|
|
2351
|
+
};
|
|
2352
|
+
this.CheckReturnData(deletedRetValCheck, retVal.body);
|
|
2353
|
+
return retVal.body;
|
|
2354
|
+
} catch (error) {
|
|
2355
|
+
if (axios.default.isAxiosError(error)) {
|
|
2356
|
+
const axiosError = error;
|
|
2357
|
+
if (axiosError.response) {
|
|
2358
|
+
if (axiosError.response.status !== StatusCodes.GONE) throw error;
|
|
2359
|
+
return null;
|
|
2360
|
+
} else throw error;
|
|
2364
2361
|
} else throw error;
|
|
2365
|
-
}
|
|
2362
|
+
}
|
|
2363
|
+
} else {
|
|
2364
|
+
console.log(resource);
|
|
2365
|
+
await (0, _nsshunt_stsutils.Sleep)(1e3);
|
|
2366
|
+
return null;
|
|
2366
2367
|
}
|
|
2367
2368
|
};
|
|
2368
2369
|
};
|