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
yarn run v1.22.19
$ NODE_OPTIONS=--experimental-vm-modules jest
(node:8739) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS src/swagger/handleJson.test.ts
PASS src/hydra/fetchJsonLd.test.ts
PASS src/utils/getResources.test.ts
FAIL src/openapi3/handleJson.test.ts
● Test suite failed to run
src/openapi3/handleJson.ts:14:15 - error TS2322: Type 'T | ReferenceObject' is not assignable to type 'object'.
Type 'T' is not assignable to type 'object'.
14 !("$ref" in maybeRef);
~~~~~~~~
src/openapi3/handleJson.ts:13:16
13 const isRef = <T>(maybeRef: T | OpenAPIV3.ReferenceObject): maybeRef is T =>
~
This type parameter might need an `extends object` constraint.
src/openapi3/handleJson.ts:180:10 - error TS2352: Conversion of type 'undefined' to type 'SchemaObject' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
180 ? (get(
~~~~
181 editOperation,
~~~~~~~~~~~~~~~~~~~~~~~~
182 "requestBody.content.application/json.schema"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183 ) as OpenAPIV3.SchemaObject)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FAIL src/hydra/parseHydraDocumentation.test.ts
● Test suite failed to run
src/hydra/parseHydraDocumentation.ts:149:26 - error TS2352: Conversion of type 'undefined' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
149 const onProperty = get(
~~~~
150 range,
~~~~~~~~~~~~~~
151 '["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#onProperty"][0]["@id"]'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152 ) as string;
~~~~~~~~~~~~~~~~~
src/hydra/parseHydraDocumentation.ts:153:29 - error TS2352: Conversion of type 'undefined' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
153 const allValuesFrom = get(
~~~~
154 range,
~~~~~~~~~~~~~~
155 '["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#allValuesFrom"][0]["@id"]'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156 ) as string;
~~~~~~~~~~~~~~~~~
src/hydra/parseHydraDocumentation.ts:256:37 - error TS2352: Conversion of type 'undefined' to type 'ExpandedRdfProperty' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
256 const supportedProperty = get(
~~~~
257 supportedProperties,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
258 '["http://www.w3.org/ns/hydra/core#property"][0]'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259 ) as ExpandedRdfProperty;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/hydra/parseHydraDocumentation.ts:261:25 - error TS2352: Conversion of type 'null' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
261 const range = get(
~~~~
262 supportedProperty,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
264 null
~~~~~~~~~~~~~~~~
265 ) as string;
~~~~~~~~~~~~~~~~~~~~~
Test Suites: 2 failed, 3 passed, 5 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 3.349 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ricfio@LENOVO:~/projects/api-platform/api-doc-parser$ yarn run test
yarn run v1.22.19
$ NODE_OPTIONS=--experimental-vm-modules jest
(node:8874) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS src/swagger/handleJson.test.ts
PASS src/hydra/fetchJsonLd.test.ts
PASS src/utils/getResources.test.ts
FAIL src/openapi3/handleJson.test.ts
● Test suite failed to run
src/openapi3/handleJson.ts:14:15 - error TS2322: Type 'ReferenceObject | T' is not assignable to type 'object'.
Type 'T' is not assignable to type 'object'.
14 !("$ref" in maybeRef);
~~~~~~~~
src/openapi3/handleJson.ts:13:16
13 const isRef = <T>(maybeRef: T | OpenAPIV3.ReferenceObject): maybeRef is T =>
~
This type parameter might need an `extends object` constraint.
src/openapi3/handleJson.ts:180:10 - error TS2352: Conversion of type 'undefined' to type 'SchemaObject' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
180 ? (get(
~~~~
181 editOperation,
~~~~~~~~~~~~~~~~~~~~~~~~
182 "requestBody.content.application/json.schema"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183 ) as OpenAPIV3.SchemaObject)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FAIL src/hydra/parseHydraDocumentation.test.ts
● Test suite failed to run
src/hydra/parseHydraDocumentation.ts:149:26 - error TS2352: Conversion of type 'undefined' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
149 const onProperty = get(
~~~~
150 range,
~~~~~~~~~~~~~~
151 '["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#onProperty"][0]["@id"]'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152 ) as string;
~~~~~~~~~~~~~~~~~
src/hydra/parseHydraDocumentation.ts:153:29 - error TS2352: Conversion of type 'undefined' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
153 const allValuesFrom = get(
~~~~
154 range,
~~~~~~~~~~~~~~
155 '["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#allValuesFrom"][0]["@id"]'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156 ) as string;
~~~~~~~~~~~~~~~~~
src/hydra/parseHydraDocumentation.ts:256:37 - error TS2352: Conversion of type 'undefined' to type 'ExpandedRdfProperty' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
256 const supportedProperty = get(
~~~~
257 supportedProperties,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
258 '["http://www.w3.org/ns/hydra/core#property"][0]'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259 ) as ExpandedRdfProperty;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/hydra/parseHydraDocumentation.ts:261:25 - error TS2352: Conversion of type 'null' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
261 const range = get(
~~~~
262 supportedProperty,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
264 null
~~~~~~~~~~~~~~~~
265 ) as string;
~~~~~~~~~~~~~~~~~~~~~
Test Suites: 2 failed, 3 passed, 5 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 3.679 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
API Doc Parser version(s) affected: 0.5.0
Description
Test
src/openapi3/handleJson.test.ts
failsHow to reproduce
yarn install
yarn run test
Possible Solution
Fixing typescript code.
Additional Context
tsc -v
yarn run test
The text was updated successfully, but these errors were encountered: