Skip to content

Commit cba6982

Browse files
committed
chore(workflow): migrate report tests added on main to rstest
1 parent a008f8c commit cba6982

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/core/tests/unit-test/report-generator-directory.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { join } from 'node:path';
99
import { parseDumpScript } from '@/dump/html-utils';
1010
import { ReportGenerator } from '@/report-generator';
1111
import { ScreenshotItem } from '@/screenshot-item';
12-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
12+
import { afterEach, beforeEach, describe, expect, it } from '@rstest/core';
1313
import {
1414
createExecution,
1515
defaultReportMeta,

packages/core/tests/unit-test/report-generator-options.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, rmSync } from 'node:fs';
22
import { dirname, join } from 'node:path';
33
import { ReportGenerator, nullReportGenerator } from '@/report-generator';
44
import { ScreenshotItem } from '@/screenshot-item';
5-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
5+
import { afterEach, beforeEach, describe, expect, it, rs } from '@rstest/core';
66
import {
77
createExecution,
88
defaultReportMeta,
@@ -21,7 +21,7 @@ describe('ReportGenerator options and factory', () => {
2121
if (existsSync(temporaryDirectory)) {
2222
rmSync(temporaryDirectory, { recursive: true, force: true });
2323
}
24-
vi.restoreAllMocks();
24+
rs.restoreAllMocks();
2525
});
2626

2727
it('provides a null generator when report generation is disabled', async () => {
@@ -119,7 +119,7 @@ describe('ReportGenerator options and factory', () => {
119119
);
120120

121121
it('prints an inline report path once after the first write', async () => {
122-
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
122+
const logSpy = rs.spyOn(console, 'log').mockImplementation(() => {});
123123
const reportPath = join(temporaryDirectory, 'autoprint-inline.html');
124124
const generator = new ReportGenerator({
125125
reportPath,
@@ -143,7 +143,7 @@ describe('ReportGenerator options and factory', () => {
143143
});
144144

145145
it('supports disabled logging and directory-mode serve instructions', async () => {
146-
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
146+
const logSpy = rs.spyOn(console, 'log').mockImplementation(() => {});
147147
const quietGenerator = new ReportGenerator({
148148
reportPath: join(temporaryDirectory, 'quiet.html'),
149149
screenshotMode: 'inline',

packages/core/tests/unit-test/report-generator-reference-images.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { restoreImageReferences } from '@/dump/screenshot-restoration';
1515
import { ReportGenerator } from '@/report-generator';
1616
import { ExecutionDump, type ExecutionTaskPlanningParam } from '@/types';
17-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
17+
import { afterEach, beforeEach, describe, expect, it } from '@rstest/core';
1818
import {
1919
defaultReportMeta,
2020
fakeBase64,

packages/core/tests/unit-test/task-executor-concurrency.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe('TaskExecutor concurrency isolation', () => {
164164
);
165165

166166
it('registers aiAct reference images when the execution is created', async () => {
167-
vi.mocked(standardPlan).mockResolvedValue({
167+
rs.mocked(standardPlan).mockResolvedValue({
168168
actions: [],
169169
yamlFlow: [],
170170
shouldContinuePlanning: false,

packages/core/tests/unit-test/tasks-null-data.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ const createMockDump = (
8383
describe('TaskExecutor - Null Data Handling', () => {
8484
it('registers insight reference images when the execution is created', async () => {
8585
const mockInsight = {
86-
contextRetrieverFn: vi.fn(async () => await createMockUIContext()),
87-
extract: vi.fn(async () => ({
86+
contextRetrieverFn: rs.fn(async () => await createMockUIContext()),
87+
extract: rs.fn(async () => ({
8888
data: { answer: 'matched' },
8989
thought: 'matched the reference',
9090
dump: createMockDump({ answer: 'matched' }),

0 commit comments

Comments
 (0)