Skip to content

Commit 62cbdfd

Browse files
committed
fix
1 parent bfaf476 commit 62cbdfd

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

eslint.config.mjs

+12
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,16 @@ export default tseslint.config(
1010
tseslint.configs.recommended,
1111
eslintConfigPrettier,
1212
eslintPluginPrettierRecommended,
13+
{
14+
rules: {
15+
"@typescript-eslint/no-unsafe-declaration-merging": "off",
16+
"@typescript-eslint/no-explicit-any": "off",
17+
"@typescript-eslint/no-empty-object-type": [
18+
"error",
19+
{
20+
allowInterfaces: "with-single-extends",
21+
},
22+
],
23+
},
24+
},
1325
);

src/hydra/parseHydraDocumentation.test.ts

+14-16
Original file line numberDiff line numberDiff line change
@@ -1584,21 +1584,19 @@ test("Resource parameters can be retrieved", async () => {
15841584
[resourceCollectionWithParameters, init],
15851585
);
15861586

1587-
await parseHydraDocumentation("http://localhost").then(
1588-
async (data: { api: Api }) => {
1589-
const resource = data.api.resources?.[0];
1590-
resource &&
1591-
resource.getParameters &&
1592-
(await resource.getParameters().then((parameters: any) => {
1593-
expect(parameters).toEqual([
1594-
{
1595-
description: "",
1596-
range: "http://www.w3.org/2001/XMLSchema#string",
1597-
required: false,
1598-
variable: "isbn",
1599-
},
1600-
]);
1601-
}));
1587+
const data: { api: Api } = await parseHydraDocumentation("http://localhost");
1588+
const resource = data.api.resources?.[0];
1589+
if (!resource?.getParameters) {
1590+
return;
1591+
}
1592+
1593+
const parameters = await resource.getParameters();
1594+
expect(parameters).toEqual([
1595+
{
1596+
description: "",
1597+
range: "http://www.w3.org/2001/XMLSchema#string",
1598+
required: false,
1599+
variable: "isbn",
16021600
},
1603-
);
1601+
]);
16041602
});

0 commit comments

Comments
 (0)