Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
33 changes: 17 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
env: {
browser: true,
commonjs: true,
jest: true,
node: true,
},
parser: '@typescript-eslint/parser',
Expand All @@ -42,7 +41,9 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react-hooks/recommended',
'plugin:jest/recommended',

'plugin:@vitest/legacy-recommended',

'airbnb',
'plugin:@typescript-eslint/recommended',
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
Expand All @@ -63,7 +64,7 @@ module.exports = {
'react-compiler',
'react-hooks',
'header',
'jest',
'@vitest',
'@typescript-eslint',
'regexp',
'@docusaurus',
Expand Down Expand Up @@ -267,7 +268,7 @@ module.exports = {
patternOptions: {matchBase: true},
position: 'after',
},
{pattern: '@jest/globals', group: 'builtin', position: 'before'},
{pattern: 'vitest', group: 'builtin', position: 'before'},
{pattern: 'react', group: 'builtin', position: 'before'},
{pattern: 'react-dom', group: 'builtin', position: 'before'},
{pattern: 'react-dom/**', group: 'builtin', position: 'before'},
Expand All @@ -294,20 +295,20 @@ module.exports = {
],
'import/prefer-default-export': OFF,

'jest/consistent-test-it': WARNING,
'jest/expect-expect': OFF,
'jest/no-large-snapshots': [
'@vitest/consistent-test-it': WARNING,
'@vitest/expect-expect': OFF,
'@vitest/no-large-snapshots': [
WARNING,
{maxSize: Infinity, inlineMaxSize: 50},
],
'jest/no-test-return-statement': ERROR,
'jest/prefer-expect-resolves': WARNING,
'jest/prefer-lowercase-title': [WARNING, {ignore: ['describe']}],
'jest/prefer-spy-on': WARNING,
'jest/prefer-to-be': OFF,
'jest/prefer-to-have-length': WARNING,
'jest/require-top-level-describe': ERROR,
'jest/valid-title': [
'@vitest/no-test-return-statement': ERROR,
'@vitest/prefer-expect-resolves': WARNING,
'@vitest/prefer-lowercase-title': [WARNING, {ignore: ['describe']}],
'@vitest/prefer-spy-on': WARNING,
'@vitest/prefer-to-be': OFF,
'@vitest/prefer-to-have-length': WARNING,
'@vitest/require-top-level-describe': ERROR,
'@vitest/valid-title': [
ERROR,
{
mustNotMatch: {
Expand Down Expand Up @@ -526,7 +527,7 @@ module.exports = {
files: [
'*.test.{js,ts,tsx}',
'admin/**',
'jest/**',
'test/**',
'website/**',
'packages/docusaurus-theme-common/removeThemeInternalReexport.mjs',
'packages/docusaurus-theme-translations/update.mjs',
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
paths:
- package.json
- yarn.lock
- jest.config.mjs
- jest/**
- vitest.config.ts
- test/**
- packages/**
- tsconfig.*.json
- .github/workflows/tests-windows.yml
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
cache: yarn
- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
- name: Docusaurus Jest Tests
- name: Docusaurus Tests
run: yarn test
- name: Create a deep path
# https://github.com/facebook/docusaurus/pull/4899
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
paths:
- package.json
- yarn.lock
- jest.config.mjs
- jest/**
- vitest.config.ts
- test/**
- packages/**
- tsconfig.*.json
- .github/workflows/tests.yml
Expand Down
5 changes: 0 additions & 5 deletions __tests__/validate-package-json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ describe('packages', () => {
packageJsonFile.content.name?.startsWith('@'),
)
.forEach((packageJsonFile) => {
// Unfortunately jest custom message do not exist in loops,
// so using an exception instead to show failing package file
// (see https://github.com/facebook/jest/issues/3293)
// expect(packageJsonFile.content.publishConfig?.access)
// .toEqual('public');
if (packageJsonFile.content.publishConfig?.access !== 'public') {
throw new Error(
`Package ${packageJsonFile.file} does not have publishConfig.access: 'public'`,
Expand Down
114 changes: 0 additions & 114 deletions jest.config.mjs

This file was deleted.

8 changes: 0 additions & 8 deletions jest/setup.ts

This file was deleted.

Loading
Loading