1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-30 05:34:38 +02:00
This commit is contained in:
kakkokari-gtyih
2026-01-06 14:21:41 +09:00
parent 40297a8427
commit 8a94fc5ef0
3 changed files with 6 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { afterAll, afterEach, beforeAll, describe, expect, test } from '@jest/globals';
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';
import { Test, TestingModule } from '@nestjs/testing';
import type { Index, MeiliSearch } from 'meilisearch';
import { type Config, loadConfig } from '@/config.js';

View File

@@ -5,7 +5,7 @@
process.env.NODE_ENV = 'test';
import { afterAll, beforeAll, beforeEach, describe, expect, jest, test } from '@jest/globals';
import { afterAll, beforeAll, beforeEach, describe, expect, vi, test } from 'vitest';
import { Test } from '@nestjs/testing';
import type { TestingModule } from '@nestjs/testing';
import type { DriveFilesRepository, DriveFoldersRepository, UsersRepository } from '@/models/_.js';
@@ -30,13 +30,13 @@ describe('DriveFileEntityService', () => {
let idCounter = 0;
const userEntityServiceMock = {
packMany: jest.fn(async (users: Array<string | { id: string }>) => {
packMany: vi.fn(async (users: Array<string | { id: string }>) => {
return users.map(u => ({
id: typeof u === 'string' ? u : u.id,
username: 'user',
}));
}),
pack: jest.fn(async (user: string | { id: string }) => {
pack: vi.fn(async (user: string | { id: string }) => {
return {
id: typeof user === 'string' ? user : user.id,
username: 'user',
@@ -195,7 +195,7 @@ describe('DriveFileEntityService', () => {
test('detail: true uses DriveFolderEntityService pack', async () => {
const folder = await createFolder('packmany-folder', null);
const file = await createFile(folder.id, null);
const packSpy = jest.spyOn(driveFolderEntityService, 'pack');
const packSpy = vi.spyOn(driveFolderEntityService, 'pack');
await service.packMany([file], { detail: true, self: true });
expect(packSpy).toHaveBeenCalled();

View File

@@ -5,7 +5,7 @@
process.env.NODE_ENV = 'test';
import { afterAll, beforeAll, describe, expect, test } from '@jest/globals';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
import { Test } from '@nestjs/testing';
import type { TestingModule } from '@nestjs/testing';
import type { DriveFilesRepository, DriveFoldersRepository } from '@/models/_.js';