feat: Add support for providers to validate their options at loading time (#8853)
* feat: Add support for providers to validate their options at loading time * fix missing removal * fix integration tests * add tests
This commit is contained in:
+6
-10
@@ -1,9 +1,10 @@
|
||||
import { generateJwtToken, MedusaError } from "@medusajs/utils"
|
||||
import { GoogleAuthService } from "../../src/services/google"
|
||||
jest.setTimeout(100000)
|
||||
import { http, HttpResponse } from "msw"
|
||||
import { setupServer } from "msw/node"
|
||||
|
||||
jest.setTimeout(100000)
|
||||
|
||||
const sampleIdPayload = {
|
||||
iss: "https://accounts.google.com",
|
||||
azp: "199301612397-l1lrg08vd6dvu98r43l7ul0ri2rd2b6r.apps.googleusercontent.com",
|
||||
@@ -97,15 +98,10 @@ describe("Google auth provider", () => {
|
||||
it("throw an error if required options are not passed", async () => {
|
||||
let msg = ""
|
||||
try {
|
||||
new GoogleAuthService(
|
||||
{
|
||||
logger: console as any,
|
||||
},
|
||||
{
|
||||
clientID: "test",
|
||||
clientSecret: "test",
|
||||
} as any
|
||||
)
|
||||
GoogleAuthService.validateOptions({
|
||||
clientID: "test",
|
||||
clientSecret: "test",
|
||||
} as any)
|
||||
} catch (e) {
|
||||
msg = e.message
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user