mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix test typings
This commit is contained in:
@@ -32,7 +32,7 @@ describe("MediaApi", () => {
|
||||
host,
|
||||
basepath,
|
||||
});
|
||||
expect(api.getFileUploadUrl({ path: "path" })).toBe(`${host}${basepath}/upload/path`);
|
||||
expect(api.getFileUploadUrl({ path: "path" } as any)).toBe(`${host}${basepath}/upload/path`);
|
||||
});
|
||||
|
||||
it("should have correct upload headers", () => {
|
||||
|
||||
@@ -7,8 +7,8 @@ describe("OAuthStrategy", async () => {
|
||||
const strategy = new OAuthStrategy({
|
||||
type: "oidc",
|
||||
client: {
|
||||
client_id: process.env.OAUTH_CLIENT_ID,
|
||||
client_secret: process.env.OAUTH_CLIENT_SECRET,
|
||||
client_id: process.env.OAUTH_CLIENT_ID!,
|
||||
client_secret: process.env.OAUTH_CLIENT_SECRET!,
|
||||
},
|
||||
name: "google",
|
||||
});
|
||||
@@ -19,11 +19,6 @@ describe("OAuthStrategy", async () => {
|
||||
const config = await strategy.getConfig();
|
||||
console.log("config", JSON.stringify(config, null, 2));
|
||||
|
||||
const request = await strategy.request({
|
||||
redirect_uri,
|
||||
state,
|
||||
});
|
||||
|
||||
const server = Bun.serve({
|
||||
fetch: async (req) => {
|
||||
const url = new URL(req.url);
|
||||
@@ -39,6 +34,11 @@ describe("OAuthStrategy", async () => {
|
||||
return new Response("Bun!");
|
||||
},
|
||||
});
|
||||
|
||||
const request = await strategy.request({
|
||||
redirect_uri,
|
||||
state,
|
||||
});
|
||||
console.log("request", request);
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 100000));
|
||||
|
||||
@@ -39,8 +39,8 @@ function makeName(ext: string) {
|
||||
return randomString(10) + "." + ext;
|
||||
}
|
||||
|
||||
/*beforeAll(disableConsoleLog);
|
||||
afterAll(enableConsoleLog);*/
|
||||
beforeAll(disableConsoleLog);
|
||||
afterAll(enableConsoleLog);
|
||||
|
||||
describe("MediaController", () => {
|
||||
test.only("accepts direct", async () => {
|
||||
@@ -56,9 +56,9 @@ describe("MediaController", () => {
|
||||
console.log(result);
|
||||
expect(result.name).toBe(name);
|
||||
|
||||
/*const destFile = Bun.file(assetsTmpPath + "/" + name);
|
||||
const destFile = Bun.file(assetsTmpPath + "/" + name);
|
||||
expect(destFile.exists()).resolves.toBe(true);
|
||||
await destFile.delete();*/
|
||||
await destFile.delete();
|
||||
});
|
||||
|
||||
test("accepts form data", async () => {
|
||||
|
||||
Reference in New Issue
Block a user