Update activitypub.ts

This commit is contained in:
syuilo 2025-05-28 21:10:20 +09:00
parent cb7d9f666b
commit 73f8a536ac
1 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,8 @@ process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
import { Test } from '@nestjs/testing';
import { jest } from '@jest/globals';
@ -29,6 +31,9 @@ import { secureRndstr } from '@/misc/secure-rndstr.js';
import { DownloadService } from '@/core/DownloadService.js';
import { genAidx } from '@/misc/id/aidx.js';
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);
const host = 'https://host1.test';
type NonTransientIActor = IActor & { id: string };
@ -124,7 +129,7 @@ describe('ActivityPub', () => {
async downloadUrl(url: string, path: string): Promise<{ filename: string }> {
if (url.endsWith('.png')) {
fs.copyFileSync(
'../resources/hw.png',
_dirname + '/../resources/hw.png',
path,
);
}