@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.
@@ -1549,7 +1549,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
1549
1549
  this.runner.instrumentData.requestCount++;
1550
1550
  const compPersonRecord = { ...personRecord };
1551
1551
  const loadedPersonRecorded = { ...retVal.body };
1552
- const loadedRecordVersion = loadedPersonRecorded.meta.versionId;
1552
+ const loadedRecordVersion = parseInt(loadedPersonRecorded.meta.versionId);
1553
1553
  delete compPersonRecord.meta;
1554
1554
  delete loadedPersonRecorded.meta;
1555
1555
  if (loadedRecordVersion > 1) compPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration % this.GetMaxIteration(prefix)}`;
@@ -2270,7 +2270,7 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
2270
2270
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2271
2271
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2272
2272
  const resource = retVal.body;
2273
- const loadedRecordVersion = resource.meta.versionId;
2273
+ const loadedRecordVersion = parseInt(resource.meta.versionId);
2274
2274
  const patchText = `Json Patched record TestCaseFhir07 ${this.runner.iteration % this.GetMaxIteration(prefix)}`;
2275
2275
  const observer = fast_json_patch_default.observe(resource);
2276
2276
  resource.text.div = patchText;
@@ -2280,12 +2280,6 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
2280
2280
  if (retValPatched.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2281
2281
  const retRecordCheck = { ...retValPatched.body };
2282
2282
  personRecord.text.div = patchText;
2283
- const zz = (loadedRecordVersion + 1).toString();
2284
- console.log(loadedRecordVersion);
2285
- console.log(typeof loadedRecordVersion);
2286
- console.log(typeof (loadedRecordVersion + 1));
2287
- console.log(typeof zz);
2288
- console.log(zz);
2289
2283
  personRecord.meta.versionId = (loadedRecordVersion + 1).toString();
2290
2284
  delete personRecord.meta.lastUpdated;
2291
2285
  delete retRecordCheck.meta.lastUpdated;
@@ -2307,7 +2301,7 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
2307
2301
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2308
2302
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2309
2303
  const resource = retVal.body;
2310
- const loadedRecordVersion = resource.meta.versionId;
2304
+ const loadedRecordVersion = parseInt(resource.meta.versionId);
2311
2305
  const patchText = `Merge Patched record TestCaseFhir08 ${this.runner.iteration & this.GetMaxIteration(prefix)}`;
2312
2306
  resource.text.div = patchText;
2313
2307
  const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"${loadedRecordVersion}"`);
@@ -2335,29 +2329,36 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
2335
2329
  const retVal = await client.GetResource("Person", personRecord.id);
2336
2330
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2337
2331
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2338
- const loadedRecordVersion = retVal.body.meta.versionId;
2339
- try {
2340
- const retVal = await client.DeleteResource("Person", personRecord.id, `W/"${loadedRecordVersion}"`);
2341
- this._CheckOutputLongDurationError(__snapshot4, "await this.DeleteResource()");
2342
- if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2343
- const deletedRetValCheck = {
2344
- resourceType: "OperationOutcome",
2345
- issue: [{
2346
- severity: "error",
2347
- code: "deleted",
2348
- diagnostics: `DeleteResource: Resource ${personRecord.id} version ${loadedRecordVersion + 1} has been deleted.`
2349
- }]
2350
- };
2351
- this.CheckReturnData(deletedRetValCheck, retVal.body);
2352
- return retVal.body;
2353
- } catch (error) {
2354
- if (axios.isAxiosError(error)) {
2355
- const axiosError = error;
2356
- if (axiosError.response) {
2357
- if (axiosError.response.status !== StatusCodes.GONE) throw error;
2358
- return null;
2332
+ const resource = retVal.body;
2333
+ if (resource.meta) {
2334
+ const loadedRecordVersion = parseInt(resource.meta.versionId);
2335
+ try {
2336
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"${loadedRecordVersion}"`);
2337
+ this._CheckOutputLongDurationError(__snapshot4, "await this.DeleteResource()");
2338
+ if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2339
+ const deletedRetValCheck = {
2340
+ resourceType: "OperationOutcome",
2341
+ issue: [{
2342
+ severity: "error",
2343
+ code: "deleted",
2344
+ diagnostics: `DeleteResource: Resource ${personRecord.id} version ${loadedRecordVersion + 1} has been deleted.`
2345
+ }]
2346
+ };
2347
+ this.CheckReturnData(deletedRetValCheck, retVal.body);
2348
+ return retVal.body;
2349
+ } catch (error) {
2350
+ if (axios.isAxiosError(error)) {
2351
+ const axiosError = error;
2352
+ if (axiosError.response) {
2353
+ if (axiosError.response.status !== StatusCodes.GONE) throw error;
2354
+ return null;
2355
+ } else throw error;
2359
2356
  } else throw error;
2360
- } else throw error;
2357
+ }
2358
+ } else {
2359
+ console.log(resource);
2360
+ await Sleep(1e3);
2361
+ return null;
2361
2362
  }
2362
2363
  };
2363
2364
  };