Skip to content

Commit

Permalink
test: fixing some flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Aug 25, 2021
1 parent e0336cd commit 1469446
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions __tests__/operation/get-requestbody-examples.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,17 @@ 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([
{
mediaType: 'application/json',
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',
},
},
Expand Down
5 changes: 3 additions & 2 deletions __tests__/operation/get-response-examples.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
{
Expand All @@ -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',
},
},
Expand Down

0 comments on commit 1469446

Please sign in to comment.