From 14694461be1ddc73d42cafafdb59379d8e7a25e3 Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Wed, 25 Aug 2021 08:52:44 -0700 Subject: [PATCH] test: fixing some flaky tests --- __tests__/operation/get-requestbody-examples.test.js | 5 +++-- __tests__/operation/get-response-examples.test.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/__tests__/operation/get-requestbody-examples.test.js b/__tests__/operation/get-requestbody-examples.test.js index b4eb866f..e478579f 100644 --- a/__tests__/operation/get-requestbody-examples.test.js +++ b/__tests__/operation/get-requestbody-examples.test.js @@ -295,6 +295,7 @@ describe('readOnly / writeOnly handling', () => { await spec.dereference(); const operation = spec.operation('/allOf', 'post'); + const today = new Date().toISOString().substring(0, 10); expect(operation.getRequestBodyExamples()).toStrictEqual([ { @@ -302,9 +303,9 @@ describe('readOnly / writeOnly handling', () => { examples: [ { value: { - end_date: '2021-08-20', + end_date: today, product_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - start_date: '2021-08-20', + start_date: today, writeOnly_primitive: 'string', }, }, diff --git a/__tests__/operation/get-response-examples.test.js b/__tests__/operation/get-response-examples.test.js index c333847c..750b655c 100644 --- a/__tests__/operation/get-response-examples.test.js +++ b/__tests__/operation/get-response-examples.test.js @@ -462,6 +462,7 @@ describe('readOnly / writeOnly handling', () => { await spec.dereference(); const operation = spec.operation('/allOf', 'post'); + const today = new Date().toISOString().substring(0, 10); expect(operation.getResponseExamples()).toStrictEqual([ { @@ -470,12 +471,12 @@ describe('readOnly / writeOnly handling', () => { 'application/json': [ { value: { - end_date: '2021-08-20', + end_date: today, end_hour: 'string', id: 'string', product_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', readOnly_primitive: 'string', - start_date: '2021-08-20', + start_date: today, start_hour: 'string', }, },