Fix jest/valid-expects lints (#11238)

This commit is contained in:
Michael Telatynski 2023-07-13 16:19:44 +01:00 committed by GitHub
parent d7d60a3255
commit f5f31eb7d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 26 deletions

View file

@ -55,8 +55,8 @@ describe("getOidcClientId()", () => {
issuer: "https://issuerWithoutStaticClientId.org/",
registrationEndpoint: undefined,
};
expect(
async () => await getOidcClientId(authConfigWithoutRegistration, clientName, baseUrl, staticOidcClients),
await expect(
getOidcClientId(authConfigWithoutRegistration, clientName, baseUrl, staticOidcClients),
).rejects.toThrow(OidcError.DynamicRegistrationNotSupported);
// didn't try to register
expect(fetchMockJest).toHaveFetchedTimes(0);
@ -67,7 +67,7 @@ describe("getOidcClientId()", () => {
...delegatedAuthConfig,
registrationEndpoint: undefined,
};
expect(async () => await getOidcClientId(authConfigWithoutRegistration, clientName, baseUrl)).rejects.toThrow(
await expect(getOidcClientId(authConfigWithoutRegistration, clientName, baseUrl)).rejects.toThrow(
OidcError.DynamicRegistrationNotSupported,
);
// didn't try to register
@ -104,7 +104,7 @@ describe("getOidcClientId()", () => {
fetchMockJest.post(registrationEndpoint, {
status: 500,
});
expect(() => getOidcClientId(delegatedAuthConfig, clientName, baseUrl)).rejects.toThrow(
await expect(getOidcClientId(delegatedAuthConfig, clientName, baseUrl)).rejects.toThrow(
OidcError.DynamicRegistrationFailed,
);
});
@ -115,7 +115,7 @@ describe("getOidcClientId()", () => {
// no clientId in response
body: "{}",
});
expect(() => getOidcClientId(delegatedAuthConfig, clientName, baseUrl)).rejects.toThrow(
await expect(getOidcClientId(delegatedAuthConfig, clientName, baseUrl)).rejects.toThrow(
OidcError.DynamicRegistrationInvalid,
);
});