Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-Windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test (vitest & playwright - Windows)
name: Test (rstest & playwright - Windows)

concurrency:
group: windows-test-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-macOS.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test (vitest & playwright - macOS)
name: Test (rstest & playwright - macOS)

concurrency:
group: macos-test-${{ github.head_ref }}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"preview:website": "cd packages/document && npm run preview",
"test": "pnpm test:unit && pnpm test:e2e",
"test:e2e": "playwright test",
"test:unit": "vitest run",
"test:unit": "rstest run",
"update:rsbuild": "npx taze minor --include /rsbuild/ -w -r -l"
},
"lint-staged": {
Expand All @@ -35,6 +35,7 @@
"@changesets/cli": "^2.29.5",
"@playwright/test": "1.53.2",
"@rspress/config": "workspace:*",
"@rstest/core": "0.0.9",
"@types/cross-spawn": "^6.0.6",
"@types/node": "^22.8.1",
"check-dependency-version-consistency": "^5.0.1",
Expand All @@ -52,7 +53,6 @@
"prettier": "3.6.2",
"prettier-plugin-packagejson": "^2.5.18",
"tree-kill": "^1.2.2",
"vitest": "2.1.9",
"zx": "^8.6.1"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/config/config-basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from '@rstest/core';
import { normalizePath } from '../../../core/src/node/utils/normalizePath';
import { loadConfigFile } from '../../src/config/loadConfigFile';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/node/auto-nav-sidebar/walk.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { DEFAULT_PAGE_EXTENSIONS } from '@rspress/shared/constants';
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from '@rstest/core';
import { RouteService } from '../route/RouteService';
import {
getRoutePathParts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
// Rstest Snapshot v1

exports[`rehypeHeadAnchor > basic 1`] = `
"const frontmatter = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'vitest';
import { describe, it } from '@rstest/core';
import { compile } from '../processor';

describe('rehypeHeadAnchor', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
// Rstest Snapshot v1

exports[`remark-container > Has space before ::: 1`] = `
"const frontmatter = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
// Rstest Snapshot v1

exports[`mdx > basic 1`] = `
"const frontmatter = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from '@rstest/core';
import { compile } from '../processor';

describe('remark-container', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'vitest';
import { describe, it } from '@rstest/core';
import { compile } from '../processor';

describe('mdx', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/node/route/RouteService.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import type { UserConfig } from '@rspress/shared';
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from '@rstest/core';
import { PluginDriver } from '../PluginDriver';
import { RouteService } from './RouteService';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/node/route/extractPageData.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from '@rstest/core';
import type { RouteService } from './RouteService';
import { extractPageData, getPageIndexInfoByRoute } from './extractPageData';

Expand Down
16 changes: 8 additions & 8 deletions packages/core/src/node/utils/checkLanguageParity.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import type { UserConfig } from '@rspress/shared';
import { logger } from '@rspress/shared/logger';
import { beforeEach, describe, expect, it, rs } from '@rstest/core';
import { fs, vol } from 'memfs';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { checkLanguageParity } from './checkLanguageParity';

vi.mock('node:fs/promises', () => {
rs.mock('node:fs/promises', () => {
return { default: fs.promises };
});
vi.mock('@rspress/shared/logger', () => ({
rs.mock('@rspress/shared/logger', () => ({
logger: {
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
success: vi.fn(),
info: rs.fn(),
warn: rs.fn(),
error: rs.fn(),
success: rs.fn(),
},
}));

describe('checkLanguageParity', () => {
beforeEach(() => {
vol.reset();
vi.clearAllMocks();
rs.clearAllMocks();
});

// base config
Expand Down
14 changes: 7 additions & 7 deletions packages/core/tests/cli/hint.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { logger } from '@rspress/shared/logger';
import { describe, it, rs } from '@rstest/core';
import { fs, vol } from 'memfs';
import { describe, it, vi } from 'vitest';
import { hintThemeBreakingChange } from '../../src/node/logger/hint';

vi.mock('node:fs/promises', () => {
rs.mock('node:fs/promises', () => {
return { default: fs.promises, ...fs.promises };
});
vi.mock('@rspress/shared/logger', () => ({
rs.mock('@rspress/shared/logger', () => ({
logger: {
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
success: vi.fn(),
info: rs.fn(),
warn: rs.fn(),
error: rs.fn(),
success: rs.fn(),
},
}));

Expand Down
6 changes: 3 additions & 3 deletions packages/runtime/src/route.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it, vi } from 'vitest';
import { describe, expect, it, rs } from '@rstest/core';
import { pathnameToRouteService } from './route';

vi.mock('virtual-routes', () => {
const element = vi.fn();
rs.mock('virtual-routes', () => {
const element = rs.fn();
const routes = [
{
path: '/api/config',
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/runtime-utils/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from '@rstest/core';
import {
normalizeHref,
normalizePosixPath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Header } from '@rspress/shared';
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from '@rstest/core';
import { backTrackHeaders } from './util';

describe('utils logic', () => {
Expand Down
10 changes: 5 additions & 5 deletions packages/theme-default/src/logic/getSidebarDataGroup.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { describe, expect, it, vi } from 'vitest';
import { describe, expect, it, rs } from '@rstest/core';
import { getSidebarDataGroup, isActive } from './getSidebarDataGroup';

vi.mock('virtual-i18n-text', () => {
rs.mock('virtual-i18n-text', () => {
return { default: {} };
});

vi.mock('virtual-runtime-config', () => {
rs.mock('virtual-runtime-config', () => {
return {
base: '/',
};
});

vi.mock('virtual-site-data', () => {
rs.mock('virtual-site-data', () => {
return {};
});

vi.mock('virtual-routes', () => {
rs.mock('virtual-routes', () => {
return { routes: [] };
});

Expand Down
Loading