You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactored schema to support running schema tests from other packages (#2899)
* Refactored schema to support runnings from other packages
- Fixed the import of `types` in `mergeSchemas.ts`
- Renamed all of the `xxx.test.ts` to `xxxTest.ts` and wrapped them in an outer `xxxTest()` function that takes a `TestValidatorType`
- Added a `types.ts` file in the `schema` directory to provide the `TestValidatorType` and `TestValidatorParams` interfaces
- Added an `index.ts` file in the `schema` directory to export all of the `xxxTest` functions
- Updated `getTestValidator()` to import the types from the `schema/types`
- Added a `test/schema.test.ts` to create a `TestValidator` and run all of the `xxxTest()` functions from `schema`
* - Fixed the tests based on using the real validator
* - Removed the use of `xxx.hasOwnProperty('y')` in favor `'y' in xxx` to eliminate lint warnings
- Fixed bug in `stubExistingAdditionalProperties()` related to the `additionalProperties: true` case, adding new test to verify fix
* - Removed console.log statement
* - Moved `stubExistingAdditionalProperties()` into the `retrieveSchema.ts` file to eliminate a circular dependency
- Did the same for the `stubExistingAdditionalPropertiesTest()` function
- Updated the `index.ts` files to remove the `stubExistingAdditionalProperties[Test]()` functions
- Updated `SchemaUtilsType` and `createSchemaUtils` to remove the `stubExistingAdditionalProperties()` function
0 commit comments