@nsshunt/ststestrunner 1.1.165 → 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.
@@ -2335,29 +2335,35 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
2335
2335
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2336
2336
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2337
2337
  const resource = retVal.body;
2338
- const loadedRecordVersion = parseInt(resource.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.default.isAxiosError(error)) {
2355
- const axiosError = error;
2356
- if (axiosError.response) {
2357
- if (axiosError.response.status !== StatusCodes.GONE) throw error;
2358
- return null;
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;
2359
2361
  } else throw error;
2360
- } else throw error;
2362
+ }
2363
+ } else {
2364
+ console.log(resource);
2365
+ await (0, _nsshunt_stsutils.Sleep)(1e3);
2366
+ return null;
2361
2367
  }
2362
2368
  };
2363
2369
  };