mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
checking media controller test
This commit is contained in:
@@ -7,6 +7,7 @@ import { mergeObject, randomString } from "../../src/core/utils";
|
||||
import type { TAppMediaConfig } from "../../src/media/media-schema";
|
||||
import { StorageLocalAdapter } from "adapter/node/storage/StorageLocalAdapter";
|
||||
import { assetsPath, assetsTmpPath, disableConsoleLog, enableConsoleLog } from "../helper";
|
||||
import { readdir } from "node:fs/promises";
|
||||
|
||||
beforeAll(() => {
|
||||
registries.media.register("local", StorageLocalAdapter);
|
||||
@@ -40,8 +41,8 @@ function makeName(ext: string) {
|
||||
return randomString(10) + "." + ext;
|
||||
}
|
||||
|
||||
beforeAll(disableConsoleLog);
|
||||
afterAll(enableConsoleLog);
|
||||
/*beforeAll(disableConsoleLog);
|
||||
afterAll(enableConsoleLog);*/
|
||||
|
||||
describe("MediaController", () => {
|
||||
test("accepts direct", async () => {
|
||||
@@ -54,6 +55,7 @@ describe("MediaController", () => {
|
||||
body: file,
|
||||
});
|
||||
const result = (await res.json()) as any;
|
||||
console.log("files", await readdir(assetsTmpPath));
|
||||
console.log(result);
|
||||
expect(result.name).toBe(name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user