feat/ci-tests (#97)

This commit is contained in:
dswbx
2025-02-26 17:15:51 +01:00
committed by GitHub
parent 253174c14e
commit b6d28bbf42
7 changed files with 46 additions and 13 deletions

View File

@@ -2,9 +2,9 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { createApp, registries } from "../../src";
import { StorageLocalAdapter } from "../../src/adapter/node";
import { mergeObject, randomString } from "../../src/core/utils";
import type { TAppMediaConfig } from "../../src/media/media-schema";
import { StorageLocalAdapter } from "../../src/media/storage/adapters/StorageLocalAdapter";
import { assetsPath, assetsTmpPath, disableConsoleLog, enableConsoleLog } from "../helper";
beforeAll(() => {
@@ -39,11 +39,11 @@ function makeName(ext: string) {
return randomString(10) + "." + ext;
}
beforeAll(disableConsoleLog);
afterAll(enableConsoleLog);
/*beforeAll(disableConsoleLog);
afterAll(enableConsoleLog);*/
describe("MediaController", () => {
test("accepts direct", async () => {
test.only("accepts direct", async () => {
const app = await makeApp();
const file = Bun.file(path);
@@ -53,11 +53,12 @@ describe("MediaController", () => {
body: file
});
const result = (await res.json()) as any;
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 () => {