mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Clone components argument to keep tests independent
This commit is contained in:
@@ -93,13 +93,15 @@ describe('DEREF FUNCTION TESTS ', function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
parameterSource = 'REQUEST',
|
parameterSource = 'REQUEST',
|
||||||
output = deref.resolveRefs(schema, parameterSource, componentsAndPaths),
|
// deref.resolveRefs modifies the input schema and components so cloning to keep tests independent of each other
|
||||||
output_withdot = deref.resolveRefs(schemaWithDotInKey, parameterSource, componentsAndPaths),
|
output = deref.resolveRefs(schema, parameterSource, _.cloneDeep(componentsAndPaths)),
|
||||||
output_customFormat = deref.resolveRefs(schemaWithCustomFormat, parameterSource, componentsAndPaths),
|
output_withdot = deref.resolveRefs(schemaWithDotInKey, parameterSource, _.cloneDeep(componentsAndPaths)),
|
||||||
output_withAllOf = deref.resolveRefs(schemaWithAllOf, parameterSource, componentsAndPaths),
|
output_customFormat = deref.resolveRefs(schemaWithCustomFormat, parameterSource,
|
||||||
output_validationTypeArray = deref.resolveRefs(schemaWithTypeArray, parameterSource, componentsAndPaths,
|
_.cloneDeep(componentsAndPaths)),
|
||||||
{}, 'VALIDATION'),
|
output_withAllOf = deref.resolveRefs(schemaWithAllOf, parameterSource, _.cloneDeep(componentsAndPaths)),
|
||||||
output_emptyObject = deref.resolveRefs(schemaWithEmptyObject, parameterSource, componentsAndPaths);
|
output_validationTypeArray = deref.resolveRefs(schemaWithTypeArray, parameterSource,
|
||||||
|
_.cloneDeep(componentsAndPaths), {}, 'VALIDATION'),
|
||||||
|
output_emptyObject = deref.resolveRefs(schemaWithEmptyObject, parameterSource, _.cloneDeep(componentsAndPaths));
|
||||||
|
|
||||||
expect(output).to.deep.include({ type: 'object',
|
expect(output).to.deep.include({ type: 'object',
|
||||||
required: ['id'],
|
required: ['id'],
|
||||||
@@ -116,7 +118,7 @@ describe('DEREF FUNCTION TESTS ', function() {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
description: 'Schema 2',
|
description: 'Schema 2',
|
||||||
properties: {
|
properties: {
|
||||||
id: { default: '<long>', type: 'integer', format: 'int64' },
|
id: { default: '<long>', type: 'integer' },
|
||||||
test_prop: { default: '<string>', type: 'string' }
|
test_prop: { default: '<string>', type: 'string' }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user