Skip to content

Commit 057ab88

Browse files
authored
refactor(test): use explicit Vitest imports, disable globals (#12019)
1 parent be553e0 commit 057ab88

187 files changed

Lines changed: 211 additions & 21 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ node_modules
66
.history
77
build
88
coverage
9-
jest.config.js
10-
jest.transform.js
11-
jest/vendor
129
examples/
1310

1411
packages/lqip-loader/lib/

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ module.exports = {
526526
// they run
527527
files: [
528528
'*.test.{js,ts,tsx}',
529+
'**/__tests__/**',
529530
'admin/**',
530531
'test/**',
531532
'website/**',

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
**/__mocks__/** linguist-generated
3636
examples/** linguist-generated
3737
.husky/** linguist-vendored
38-
jest/** linguist-vendored
38+
test/** linguist-vendored
3939
admin/** linguist-documentation
4040
website/** linguist-documentation
4141
packages/create-docusaurus/templates/** linguist-vendored
4242
.eslintrc.* linguist-vendored
43-
jest.config.* linguist-vendored
43+
vitest.config.* linguist-vendored
4444
.stylelintrc.* linguist-vendored

.github/workflows/tests-e2e.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
paths:
99
- package.json
1010
- yarn.lock
11-
- jest.config.mjs
12-
- jest/**
11+
- vitest.config.ts
12+
- test/**
1313
- packages/**
1414
- tsconfig.*.json
1515
pull_request:
@@ -19,8 +19,8 @@ on:
1919
paths:
2020
- package.json
2121
- yarn.lock
22-
- jest.config.mjs
23-
- jest/**
22+
- vitest.config.ts
23+
- test/**
2424
- packages/**
2525
- tsconfig.*.json
2626
- admin/verdaccio.yaml

__tests__/validate-package-json.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import {describe, expect, it} from 'vitest';
89
import fs from 'fs-extra';
910
import {Globby} from '@docusaurus/utils';
1011

__tests__/validate-tsconfig.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import {describe, it} from 'vitest';
89
import fs from 'fs-extra';
910
import {Globby} from '@docusaurus/utils';
1011
import {Joi} from '@docusaurus/utils-validation';

packages/create-docusaurus/src/__tests__/utils.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import {describe, expect, it} from 'vitest';
89
import {siteNameToPackageName} from '../utils';
910

1011
describe('siteNameToPackageName', () => {

packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import {describe, expect, it, vi} from 'vitest';
89
import fs from 'fs-extra';
910
import tmp from 'tmp-promise';
1011
import {getBabelOptions} from '../utils';

packages/docusaurus-bundler/src/loaders/__tests__/jsLoader.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import {describe, expect, it} from 'vitest';
89
import {fromPartial, type PartialDeep} from '@total-typescript/shoehorn';
910
import {createJsLoaderFactory} from '../jsLoader';
1011

packages/docusaurus-cssnano-preset/src/remove-overridden-custom-properties/__tests__/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import {describe, expect, it} from 'vitest';
89
import path from 'path';
910
import vfile from 'to-vfile';
1011
import postcss from 'postcss';

0 commit comments

Comments
 (0)