mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
feat/ci-tests (#97)
This commit is contained in:
@@ -14,6 +14,8 @@ const {
|
||||
const ALL_TESTS = !!process.env.ALL_TESTS;
|
||||
|
||||
describe.skipIf(ALL_TESTS)("StorageCloudinaryAdapter", () => {
|
||||
if (ALL_TESTS) return;
|
||||
|
||||
const adapter = new StorageCloudinaryAdapter({
|
||||
cloud_name: CLOUDINARY_CLOUD_NAME as string,
|
||||
api_key: CLOUDINARY_API_KEY as string,
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { randomString } from "../../../src/core/utils";
|
||||
import { StorageLocalAdapter } from "../../../src/media/storage/adapters/StorageLocalAdapter";
|
||||
import { assetsPath, assetsTmpPath } from "../../helper";
|
||||
|
||||
describe("StorageLocalAdapter", () => {
|
||||
const adapter = new StorageLocalAdapter({
|
||||
path: `${import.meta.dir}/local`
|
||||
path: assetsTmpPath
|
||||
});
|
||||
|
||||
const file = Bun.file(`${import.meta.dir}/icon.png`);
|
||||
const file = Bun.file(`${assetsPath}/image.png`);
|
||||
const _filename = randomString(10);
|
||||
const filename = `${_filename}.png`;
|
||||
|
||||
|
||||
@@ -9,9 +9,11 @@ const { R2_ACCESS_KEY, R2_SECRET_ACCESS_KEY, R2_URL, AWS_ACCESS_KEY, AWS_SECRET_
|
||||
|
||||
// @todo: mock r2/s3 responses for faster tests
|
||||
const ALL_TESTS = !!process.env.ALL_TESTS;
|
||||
console.log("ALL_TESTS?", ALL_TESTS);
|
||||
|
||||
describe.skipIf(true)("StorageS3Adapter", async () => {
|
||||
if (ALL_TESTS) return;
|
||||
|
||||
describe.skipIf(ALL_TESTS)("StorageS3Adapter", async () => {
|
||||
console.log("ALL_TESTS", process.env.ALL_TESTS);
|
||||
const versions = [
|
||||
[
|
||||
"r2",
|
||||
@@ -55,7 +57,7 @@ describe.skipIf(ALL_TESTS)("StorageS3Adapter", async () => {
|
||||
|
||||
// @todo: add mocked fetch for faster tests
|
||||
describe.each(versions)("StorageS3Adapter for %s", async (name, adapter) => {
|
||||
if (!_conf.adapters.includes(name)) {
|
||||
if (!_conf.adapters.includes(name) || ALL_TESTS) {
|
||||
console.log("Skipping", name);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user