From a2e0897fc2669a299bedd5903ffead676e5c71bf Mon Sep 17 00:00:00 2001 From: fukaoi Date: Wed, 4 Sep 2024 13:37:56 +0900 Subject: [PATCH] added bucket name in credential --- packages/suite-storage/test/filebase.test.ts | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/suite-storage/test/filebase.test.ts b/packages/suite-storage/test/filebase.test.ts index f38d9c21c..af7f44978 100644 --- a/packages/suite-storage/test/filebase.test.ts +++ b/packages/suite-storage/test/filebase.test.ts @@ -1,6 +1,8 @@ import test from 'ava'; import { RandomAsset } from 'test-tools/setupAsset'; import { Filebase } from '../src/filebase'; +import { Constants } from '~/suite-utils'; +import { execSync } from 'child_process'; test('Upload file', async (t) => { const asset = RandomAsset.get(); @@ -47,3 +49,22 @@ test('Remove objects in buckets', async (t) => { }, ); }); + +test('Upload file with custom parameter', async (t) => { + execSync( + 'pnpm solana-suite-config -f 9CA51CEFF9FF98CB91CF CgjYuMvs2NdFGbLPyFDSWESaO05nobQ9mp16PPDo firedancer', + ); + const asset = RandomAsset.get(); + const res = await Filebase.uploadFile(asset.filePath!); + + res.match( + (ok) => { + t.pass(); + t.log(`# filebase ipfs url: ${ok}`); + }, + (err) => { + console.error(err); + t.fail(err.message); + }, + ); +});