fix test
This commit is contained in:
parent
1d8e183883
commit
299f9e3115
|
|
@ -317,7 +317,7 @@ export const uploadFile = async (user?: UserToken, { path, name, blob }: UploadO
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', blob ??
|
formData.append('file', blob ??
|
||||||
new File([await readFile(absPath)], basename(absPath.toString())));
|
new File([new Uint8Array(await readFile(absPath))], basename(absPath.toString())));
|
||||||
formData.append('force', 'true');
|
formData.append('force', 'true');
|
||||||
if (name) {
|
if (name) {
|
||||||
formData.append('name', name);
|
formData.append('name', name);
|
||||||
|
|
@ -608,8 +608,8 @@ export async function initTestDb(justBorrow = false, initEntities?: any[]) {
|
||||||
username: config.db.user,
|
username: config.db.user,
|
||||||
password: config.db.pass,
|
password: config.db.pass,
|
||||||
database: config.db.db,
|
database: config.db.db,
|
||||||
synchronize: true && !justBorrow,
|
synchronize: !justBorrow,
|
||||||
dropSchema: true && !justBorrow,
|
dropSchema: !justBorrow,
|
||||||
entities: initEntities ?? entities,
|
entities: initEntities ?? entities,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -661,7 +661,9 @@ export async function captureWebhook<T = SystemWebhookPayload>(postAction: () =>
|
||||||
let timeoutHandle: NodeJS.Timeout | null = null;
|
let timeoutHandle: NodeJS.Timeout | null = null;
|
||||||
const result = await new Promise<string>(async (resolve, reject) => {
|
const result = await new Promise<string>(async (resolve, reject) => {
|
||||||
fastify.all('/', async (req, res) => {
|
fastify.all('/', async (req, res) => {
|
||||||
timeoutHandle && clearTimeout(timeoutHandle);
|
if (timeoutHandle) {
|
||||||
|
clearTimeout(timeoutHandle);
|
||||||
|
}
|
||||||
|
|
||||||
const body = JSON.stringify(req.body);
|
const body = JSON.stringify(req.body);
|
||||||
res.status(200).send('ok');
|
res.status(200).send('ok');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue