[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

chore(deps): update `@antfu/eslint-config` v3.8.0 (#6751)

authored by

Hiroshi Ogawa and committed by
GitHub
(Oct 23, 2024, 1:18 PM +0200) de74785e 9d9bad5b

+1867 -1825
+3
eslint.config.js
··· 98 98 files: [ 99 99 `docs/${GLOB_SRC}`, 100 100 `**/*.md`, 101 + `**/*.md/${GLOB_SRC}`, 101 102 ], 102 103 rules: { 104 + 'perfectionist/sort-imports': 'off', 103 105 'style/max-statements-per-line': 'off', 104 106 'import/newline-after-import': 'off', 105 107 'import/first': 'off', ··· 122 124 `test/${GLOB_SRC}`, 123 125 ], 124 126 rules: { 127 + 'antfu/no-top-level-await': 'off', 125 128 'unicorn/consistent-function-scoping': 'off', 126 129 }, 127 130 },
+1 -1
package.json
··· 36 36 "test:browser:playwright": "pnpm -C test/browser run test:playwright" 37 37 }, 38 38 "devDependencies": { 39 - "@antfu/eslint-config": "3.0.0", 39 + "@antfu/eslint-config": "^3.8.0", 40 40 "@antfu/ni": "^0.23.0", 41 41 "@playwright/test": "^1.48.0", 42 42 "@rollup/plugin-commonjs": "^28.0.0",
+229 -186
pnpm-lock.yaml
··· 38 38 .: 39 39 devDependencies: 40 40 '@antfu/eslint-config': 41 - specifier: 3.0.0 42 - version: 3.0.0(@typescript-eslint/utils@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(@vue/compiler-sfc@3.5.12)(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vitest@packages+vitest) 41 + specifier: ^3.8.0 42 + version: 3.8.0(@typescript-eslint/utils@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(@vue/compiler-sfc@3.5.12)(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vitest@packages+vitest) 43 43 '@antfu/ni': 44 44 specifier: ^0.23.0 45 45 version: 0.23.0 ··· 803 803 version: 29.6.3 804 804 tinyhighlight: 805 805 specifier: ^0.3.2 806 - version: 0.3.2(picocolors@1.1.0) 806 + version: 0.3.2(picocolors@1.1.1) 807 807 808 808 packages/vite-node: 809 809 dependencies: ··· 1498 1498 resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} 1499 1499 engines: {node: '>=6.0.0'} 1500 1500 1501 - '@antfu/eslint-config@3.0.0': 1502 - resolution: {integrity: sha512-3HC35LrsW5kvHyVY2U6yat3Uz20/9Re5137LAKqAtl2tKictef2CmdYk5z+qK4UsaY32MMfg98MhuBbvAvZF1w==} 1501 + '@antfu/eslint-config@3.8.0': 1502 + resolution: {integrity: sha512-O5QSufPHpKTm0wk1OQ5c2mOZVzCqYV3hIDrt5zt+cOWqiG8YXLPkSOD4fFwjomATtOuUbcLUwkcgY5dErM7aIw==} 1503 1503 hasBin: true 1504 1504 peerDependencies: 1505 1505 '@eslint-react/eslint-plugin': ^1.5.8 1506 1506 '@prettier/plugin-xml': ^3.4.1 1507 1507 '@unocss/eslint-plugin': '>=0.50.0' 1508 1508 astro-eslint-parser: ^1.0.2 1509 - eslint: ^9.5.0 1509 + eslint: ^9.10.0 1510 1510 eslint-plugin-astro: ^1.2.0 1511 1511 eslint-plugin-format: '>=0.1.0' 1512 - eslint-plugin-react-hooks: ^4.6.0 1512 + eslint-plugin-react-hooks: ^5.0.0 1513 1513 eslint-plugin-react-refresh: ^0.4.4 1514 - eslint-plugin-solid: ^0.13.2 1514 + eslint-plugin-solid: ^0.14.3 1515 1515 eslint-plugin-svelte: '>=2.35.1' 1516 1516 prettier-plugin-astro: ^0.13.0 1517 1517 prettier-plugin-slidev: ^1.0.5 ··· 2961 2961 resolution: {integrity: sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==} 2962 2962 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 2963 2963 2964 + '@eslint/markdown@6.2.1': 2965 + resolution: {integrity: sha512-cKVd110hG4ICHmWhIwZJfKmmJBvbiDWyrHODJknAtudKgZtlROGoLX9UEOA0o746zC0hCY4UV4vR+aOGW9S6JQ==} 2966 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 2967 + 2964 2968 '@eslint/object-schema@2.1.4': 2965 2969 resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} 2966 2970 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} ··· 3608 3612 '@types/debug@4.1.12': 3609 3613 resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} 3610 3614 3611 - '@types/eslint@9.6.1': 3612 - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} 3613 - 3614 3615 '@types/estree@0.0.39': 3615 3616 resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} 3616 3617 ··· 3670 3671 3671 3672 '@types/markdown-it@14.1.2': 3672 3673 resolution: {integrity: sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==} 3673 - 3674 - '@types/mdast@3.0.15': 3675 - resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} 3676 3674 3677 3675 '@types/mdast@4.0.3': 3678 3676 resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} ··· 3761 3759 '@types/ungap__structured-clone@1.2.0': 3762 3760 resolution: {integrity: sha512-ZoaihZNLeZSxESbk9PUAPZOlSpcKx81I1+4emtULDVmBLkYutTcMlCj2K9VNlf9EWODxdO6gkAqEaLorXwZQVA==} 3763 3761 3764 - '@types/unist@2.0.11': 3765 - resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} 3766 - 3767 3762 '@types/unist@3.0.2': 3768 3763 resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} 3769 3764 ··· 3791 3786 '@types/yauzl@2.10.3': 3792 3787 resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} 3793 3788 3794 - '@typescript-eslint/eslint-plugin@8.8.1': 3795 - resolution: {integrity: sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==} 3789 + '@typescript-eslint/eslint-plugin@8.10.0': 3790 + resolution: {integrity: sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==} 3796 3791 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3797 3792 peerDependencies: 3798 3793 '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 ··· 3802 3797 typescript: 3803 3798 optional: true 3804 3799 3805 - '@typescript-eslint/parser@8.8.1': 3806 - resolution: {integrity: sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==} 3800 + '@typescript-eslint/parser@8.10.0': 3801 + resolution: {integrity: sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==} 3807 3802 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3808 3803 peerDependencies: 3809 3804 eslint: ^8.57.0 || ^9.0.0 ··· 3812 3807 typescript: 3813 3808 optional: true 3814 3809 3810 + '@typescript-eslint/scope-manager@8.10.0': 3811 + resolution: {integrity: sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw==} 3812 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3813 + 3815 3814 '@typescript-eslint/scope-manager@8.8.1': 3816 3815 resolution: {integrity: sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==} 3817 3816 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3818 3817 3819 - '@typescript-eslint/type-utils@8.8.1': 3820 - resolution: {integrity: sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==} 3818 + '@typescript-eslint/type-utils@8.10.0': 3819 + resolution: {integrity: sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==} 3821 3820 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3822 3821 peerDependencies: 3823 3822 typescript: '*' ··· 3825 3824 typescript: 3826 3825 optional: true 3827 3826 3827 + '@typescript-eslint/types@8.10.0': 3828 + resolution: {integrity: sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==} 3829 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3830 + 3828 3831 '@typescript-eslint/types@8.8.1': 3829 3832 resolution: {integrity: sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==} 3830 3833 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3834 + 3835 + '@typescript-eslint/typescript-estree@8.10.0': 3836 + resolution: {integrity: sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w==} 3837 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3838 + peerDependencies: 3839 + typescript: '*' 3840 + peerDependenciesMeta: 3841 + typescript: 3842 + optional: true 3831 3843 3832 3844 '@typescript-eslint/typescript-estree@8.8.1': 3833 3845 resolution: {integrity: sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==} ··· 3838 3850 typescript: 3839 3851 optional: true 3840 3852 3853 + '@typescript-eslint/utils@8.10.0': 3854 + resolution: {integrity: sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==} 3855 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3856 + peerDependencies: 3857 + eslint: ^8.57.0 || ^9.0.0 3858 + 3841 3859 '@typescript-eslint/utils@8.8.1': 3842 3860 resolution: {integrity: sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==} 3843 3861 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3844 3862 peerDependencies: 3845 3863 eslint: ^8.57.0 || ^9.0.0 3864 + 3865 + '@typescript-eslint/visitor-keys@8.10.0': 3866 + resolution: {integrity: sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A==} 3867 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 3846 3868 3847 3869 '@typescript-eslint/visitor-keys@8.8.1': 3848 3870 resolution: {integrity: sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==} ··· 4698 4720 character-entities-html4@2.1.0: 4699 4721 resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} 4700 4722 4701 - character-entities-legacy@1.1.4: 4702 - resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} 4703 - 4704 4723 character-entities-legacy@3.0.0: 4705 4724 resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} 4706 4725 4707 - character-entities@1.2.4: 4708 - resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} 4709 - 4710 4726 character-entities@2.0.2: 4711 4727 resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} 4712 - 4713 - character-reference-invalid@1.1.4: 4714 - resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} 4715 4728 4716 4729 chardet@0.7.0: 4717 4730 resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} ··· 5476 5489 peerDependencies: 5477 5490 eslint: ^9.5.0 5478 5491 5479 - eslint-flat-config-utils@0.3.1: 5480 - resolution: {integrity: sha512-eFT3EaoJN1hlN97xw4FIEX//h0TiFUobgl2l5uLkIwhVN9ahGq95Pbs+i1/B5UACA78LO3rco3JzuvxLdTUOPA==} 5492 + eslint-flat-config-utils@0.4.0: 5493 + resolution: {integrity: sha512-kfd5kQZC+BMO0YwTol6zxjKX1zAsk8JfSAopbKjKqmENTJcew+yBejuvccAg37cvOrN0Mh+DVbeyznuNWEjt4A==} 5481 5494 5482 5495 eslint-import-resolver-node@0.3.9: 5483 5496 resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} ··· 5509 5522 peerDependencies: 5510 5523 eslint: ^8.57.0 || ^9.0.0 5511 5524 5512 - eslint-plugin-jsdoc@50.4.0: 5513 - resolution: {integrity: sha512-UT7mfB4x9XgBTCrg8VxsOnZ+uglKG09RkAVfaIRHSF/YdiXx32ix9B0IZ8aiGAvloGNkBMSi19mTQUk3aEAMQA==} 5525 + eslint-plugin-jsdoc@50.4.3: 5526 + resolution: {integrity: sha512-uWtwFxGRv6B8sU63HZM5dAGDhgsatb+LONwmILZJhdRALLOkCX2HFZhdL/Kw2ls8SQMAVEfK+LmnEfxInRN8HA==} 5514 5527 engines: {node: '>=18'} 5515 5528 peerDependencies: 5516 5529 eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 ··· 5520 5533 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 5521 5534 peerDependencies: 5522 5535 eslint: '>=6.0.0' 5523 - 5524 - eslint-plugin-markdown@5.1.0: 5525 - resolution: {integrity: sha512-SJeyKko1K6GwI0AN6xeCDToXDkfKZfXcexA6B+O2Wr2btUS9GrC+YgwSyVli5DJnctUHjFXcQ2cqTaAmVoLi2A==} 5526 - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 5527 - peerDependencies: 5528 - eslint: '>=8' 5529 5536 5530 5537 eslint-plugin-n@17.11.1: 5531 5538 resolution: {integrity: sha512-93IUD82N6tIEgjztVI/l3ElHtC2wTa9boJHrD8iN+NyDxjxz/daZUZKfkedjBZNdg6EqDk4irybUsiPwDqXAEA==} ··· 5537 5544 resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==} 5538 5545 engines: {node: '>=5.0.0'} 5539 5546 5540 - eslint-plugin-perfectionist@3.8.0: 5541 - resolution: {integrity: sha512-BYJWbQVOjvIGK9V1xUfn790HuvkePjxti8epOi1H6sdzo0N4RehBmQ8coHPbgA/f12BUG1NIoDtQhI9mUm+o2A==} 5547 + eslint-plugin-perfectionist@3.9.1: 5548 + resolution: {integrity: sha512-9WRzf6XaAxF4Oi5t/3TqKP5zUjERhasHmLFHin2Yw6ZAp/EP/EVA2dr3BhQrrHWCm5SzTMZf0FcjDnBkO2xFkA==} 5542 5549 engines: {node: ^18.0.0 || >=20.0.0} 5543 5550 peerDependencies: 5544 5551 astro-eslint-parser: ^1.0.2 ··· 5568 5575 peerDependencies: 5569 5576 eslint: '>=6.0.0' 5570 5577 5571 - eslint-plugin-unicorn@55.0.0: 5572 - resolution: {integrity: sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==} 5578 + eslint-plugin-unicorn@56.0.0: 5579 + resolution: {integrity: sha512-aXpddVz/PQMmd69uxO98PA4iidiVNvA0xOtbpUoz1WhBd4RxOQQYqN618v68drY0hmy5uU2jy1bheKEVWBjlPw==} 5573 5580 engines: {node: '>=18.18'} 5574 5581 peerDependencies: 5575 5582 eslint: '>=8.56.0' ··· 6075 6082 resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} 6076 6083 engines: {node: '>=18'} 6077 6084 6078 - globals@15.9.0: 6079 - resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} 6085 + globals@15.11.0: 6086 + resolution: {integrity: sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==} 6080 6087 engines: {node: '>=18'} 6081 6088 6082 6089 globalthis@1.0.4: ··· 6361 6368 resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} 6362 6369 engines: {node: '>= 0.10'} 6363 6370 6364 - is-alphabetical@1.0.4: 6365 - resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} 6366 - 6367 - is-alphanumerical@1.0.4: 6368 - resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} 6369 - 6370 6371 is-arguments@1.1.1: 6371 6372 resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} 6372 6373 engines: {node: '>= 0.4'} ··· 6414 6415 resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} 6415 6416 engines: {node: '>= 0.4'} 6416 6417 6417 - is-decimal@1.0.4: 6418 - resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} 6419 - 6420 6418 is-docker@2.2.1: 6421 6419 resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} 6422 6420 engines: {node: '>=8'} ··· 6442 6440 is-glob@4.0.3: 6443 6441 resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 6444 6442 engines: {node: '>=0.10.0'} 6445 - 6446 - is-hexadecimal@1.0.4: 6447 - resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} 6448 6443 6449 6444 is-inside-container@1.0.0: 6450 6445 resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} ··· 6951 6946 mdast-util-find-and-replace@3.0.1: 6952 6947 resolution: {integrity: sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==} 6953 6948 6954 - mdast-util-from-markdown@0.8.5: 6955 - resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} 6956 - 6957 6949 mdast-util-from-markdown@2.0.1: 6958 6950 resolution: {integrity: sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==} 6959 6951 ··· 6983 6975 6984 6976 mdast-util-to-markdown@2.1.0: 6985 6977 resolution: {integrity: sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==} 6986 - 6987 - mdast-util-to-string@2.0.0: 6988 - resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} 6989 6978 6990 6979 mdast-util-to-string@4.0.0: 6991 6980 resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} ··· 7017 7006 7018 7007 micromark-core-commonmark@2.0.0: 7019 7008 resolution: {integrity: sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==} 7009 + 7010 + micromark-extension-gfm-autolink-literal@2.1.0: 7011 + resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} 7012 + 7013 + micromark-extension-gfm-footnote@2.1.0: 7014 + resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==} 7015 + 7016 + micromark-extension-gfm-strikethrough@2.1.0: 7017 + resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==} 7018 + 7019 + micromark-extension-gfm-table@2.1.0: 7020 + resolution: {integrity: sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g==} 7021 + 7022 + micromark-extension-gfm-tagfilter@2.0.0: 7023 + resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} 7024 + 7025 + micromark-extension-gfm-task-list-item@2.1.0: 7026 + resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==} 7027 + 7028 + micromark-extension-gfm@3.0.0: 7029 + resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} 7020 7030 7021 7031 micromark-factory-destination@2.0.0: 7022 7032 resolution: {integrity: sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==} ··· 7074 7084 7075 7085 micromark-util-types@2.0.0: 7076 7086 resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} 7077 - 7078 - micromark@2.11.4: 7079 - resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} 7080 7087 7081 7088 micromark@4.0.0: 7082 7089 resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} ··· 7494 7501 resolution: {integrity: sha512-OZQaqKaQnR21iqhlnPfVisFjBWjhnMl5J9MgbP8xC+EwoVqbXrq78lp+9Zb3ahmLzrIX5Us/qbvBnaS3hkH6OA==} 7495 7502 engines: {node: '>=6'} 7496 7503 7497 - parse-entities@2.0.0: 7498 - resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} 7499 - 7500 7504 parse-gitignore@2.0.0: 7501 7505 resolution: {integrity: sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==} 7502 7506 engines: {node: '>=14'} ··· 7594 7598 7595 7599 picocolors@1.1.0: 7596 7600 resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} 7601 + 7602 + picocolors@1.1.1: 7603 + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} 7597 7604 7598 7605 picomatch@2.3.1: 7599 7606 resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} ··· 8897 8904 unist-util-position@5.0.0: 8898 8905 resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} 8899 8906 8900 - unist-util-stringify-position@2.0.3: 8901 - resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} 8902 - 8903 8907 unist-util-stringify-position@4.0.0: 8904 8908 resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} 8905 8909 ··· 9686 9690 '@jridgewell/gen-mapping': 0.3.5 9687 9691 '@jridgewell/trace-mapping': 0.3.25 9688 9692 9689 - '@antfu/eslint-config@3.0.0(@typescript-eslint/utils@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(@vue/compiler-sfc@3.5.12)(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vitest@packages+vitest)': 9693 + '@antfu/eslint-config@3.8.0(@typescript-eslint/utils@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(@vue/compiler-sfc@3.5.12)(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vitest@packages+vitest)': 9690 9694 dependencies: 9691 9695 '@antfu/install-pkg': 0.4.1 9692 9696 '@clack/prompts': 0.7.0 9693 9697 '@eslint-community/eslint-plugin-eslint-comments': 4.4.0(eslint@9.12.0(jiti@1.21.6)) 9698 + '@eslint/markdown': 6.2.1 9694 9699 '@stylistic/eslint-plugin': 2.9.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 9695 - '@typescript-eslint/eslint-plugin': 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 9696 - '@typescript-eslint/parser': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 9697 - '@vitest/eslint-plugin': 1.1.7(@typescript-eslint/utils@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)(vitest@packages+vitest) 9700 + '@typescript-eslint/eslint-plugin': 8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 9701 + '@typescript-eslint/parser': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 9702 + '@vitest/eslint-plugin': 1.1.7(@typescript-eslint/utils@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)(vitest@packages+vitest) 9698 9703 eslint: 9.12.0(jiti@1.21.6) 9699 9704 eslint-config-flat-gitignore: 0.3.0(eslint@9.12.0(jiti@1.21.6)) 9700 - eslint-flat-config-utils: 0.3.1 9705 + eslint-flat-config-utils: 0.4.0 9701 9706 eslint-merge-processors: 0.1.0(eslint@9.12.0(jiti@1.21.6)) 9702 9707 eslint-plugin-antfu: 2.7.0(eslint@9.12.0(jiti@1.21.6)) 9703 9708 eslint-plugin-command: 0.2.6(eslint@9.12.0(jiti@1.21.6)) 9704 9709 eslint-plugin-import-x: 4.3.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 9705 - eslint-plugin-jsdoc: 50.4.0(eslint@9.12.0(jiti@1.21.6)) 9710 + eslint-plugin-jsdoc: 50.4.3(eslint@9.12.0(jiti@1.21.6)) 9706 9711 eslint-plugin-jsonc: 2.16.0(eslint@9.12.0(jiti@1.21.6)) 9707 - eslint-plugin-markdown: 5.1.0(eslint@9.12.0(jiti@1.21.6)) 9708 9712 eslint-plugin-n: 17.11.1(eslint@9.12.0(jiti@1.21.6)) 9709 9713 eslint-plugin-no-only-tests: 3.3.0 9710 - eslint-plugin-perfectionist: 3.8.0(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vue-eslint-parser@9.4.3(eslint@9.12.0(jiti@1.21.6))) 9714 + eslint-plugin-perfectionist: 3.9.1(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vue-eslint-parser@9.4.3(eslint@9.12.0(jiti@1.21.6))) 9711 9715 eslint-plugin-regexp: 2.6.0(eslint@9.12.0(jiti@1.21.6)) 9712 9716 eslint-plugin-toml: 0.11.1(eslint@9.12.0(jiti@1.21.6)) 9713 - eslint-plugin-unicorn: 55.0.0(eslint@9.12.0(jiti@1.21.6)) 9714 - eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/eslint-plugin@8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6)) 9717 + eslint-plugin-unicorn: 56.0.0(eslint@9.12.0(jiti@1.21.6)) 9718 + eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/eslint-plugin@8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6)) 9715 9719 eslint-plugin-vue: 9.29.0(eslint@9.12.0(jiti@1.21.6)) 9716 9720 eslint-plugin-yml: 1.14.0(eslint@9.12.0(jiti@1.21.6)) 9717 9721 eslint-processor-vue-blocks: 0.1.2(@vue/compiler-sfc@3.5.12)(eslint@9.12.0(jiti@1.21.6)) 9718 - globals: 15.9.0 9722 + globals: 15.11.0 9719 9723 jsonc-eslint-parser: 2.4.0 9720 9724 local-pkg: 0.5.0 9721 9725 parse-gitignore: 2.0.0 9722 - picocolors: 1.1.0 9726 + picocolors: 1.1.1 9723 9727 toml-eslint-parser: 0.10.0 9724 9728 vue-eslint-parser: 9.4.3(eslint@9.12.0(jiti@1.21.6)) 9725 9729 yaml-eslint-parser: 1.2.3 ··· 10798 10802 10799 10803 '@clack/core@0.3.4': 10800 10804 dependencies: 10801 - picocolors: 1.1.0 10805 + picocolors: 1.1.1 10802 10806 sisteransi: 1.0.5 10803 10807 10804 10808 '@clack/prompts@0.7.0': 10805 10809 dependencies: 10806 10810 '@clack/core': 0.3.4 10807 - picocolors: 1.1.0 10811 + picocolors: 1.1.1 10808 10812 sisteransi: 1.0.5 10809 10813 10810 10814 '@docsearch/css@3.6.2': {} ··· 11174 11178 - supports-color 11175 11179 11176 11180 '@eslint/js@9.12.0': {} 11181 + 11182 + '@eslint/markdown@6.2.1': 11183 + dependencies: 11184 + '@eslint/plugin-kit': 0.2.0 11185 + mdast-util-from-markdown: 2.0.1 11186 + mdast-util-gfm: 3.0.0 11187 + micromark-extension-gfm: 3.0.0 11188 + transitivePeerDependencies: 11189 + - supports-color 11177 11190 11178 11191 '@eslint/object-schema@2.1.4': {} 11179 11192 ··· 11912 11925 dependencies: 11913 11926 '@types/ms': 0.7.31 11914 11927 11915 - '@types/eslint@9.6.1': 11916 - dependencies: 11917 - '@types/estree': 1.0.6 11918 - '@types/json-schema': 7.0.15 11919 - 11920 11928 '@types/estree@0.0.39': {} 11921 11929 11922 11930 '@types/estree@1.0.5': {} ··· 11995 12003 dependencies: 11996 12004 '@types/linkify-it': 5.0.0 11997 12005 '@types/mdurl': 2.0.0 11998 - 11999 - '@types/mdast@3.0.15': 12000 - dependencies: 12001 - '@types/unist': 2.0.11 12002 12006 12003 12007 '@types/mdast@4.0.3': 12004 12008 dependencies: ··· 12087 12091 12088 12092 '@types/ungap__structured-clone@1.2.0': {} 12089 12093 12090 - '@types/unist@2.0.11': {} 12091 - 12092 12094 '@types/unist@3.0.2': {} 12093 12095 12094 12096 '@types/web-bluetooth@0.0.20': {} ··· 12118 12120 '@types/node': 22.7.5 12119 12121 optional: true 12120 12122 12121 - '@typescript-eslint/eslint-plugin@8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12123 + '@typescript-eslint/eslint-plugin@8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12122 12124 dependencies: 12123 12125 '@eslint-community/regexpp': 4.11.0 12124 - '@typescript-eslint/parser': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12125 - '@typescript-eslint/scope-manager': 8.8.1 12126 - '@typescript-eslint/type-utils': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12127 - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12128 - '@typescript-eslint/visitor-keys': 8.8.1 12126 + '@typescript-eslint/parser': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12127 + '@typescript-eslint/scope-manager': 8.10.0 12128 + '@typescript-eslint/type-utils': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12129 + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12130 + '@typescript-eslint/visitor-keys': 8.10.0 12129 12131 eslint: 9.12.0(jiti@1.21.6) 12130 12132 graphemer: 1.4.0 12131 12133 ignore: 5.3.1 ··· 12136 12138 transitivePeerDependencies: 12137 12139 - supports-color 12138 12140 12139 - '@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12141 + '@typescript-eslint/parser@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12140 12142 dependencies: 12141 - '@typescript-eslint/scope-manager': 8.8.1 12142 - '@typescript-eslint/types': 8.8.1 12143 - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.6.3) 12144 - '@typescript-eslint/visitor-keys': 8.8.1 12143 + '@typescript-eslint/scope-manager': 8.10.0 12144 + '@typescript-eslint/types': 8.10.0 12145 + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) 12146 + '@typescript-eslint/visitor-keys': 8.10.0 12145 12147 debug: 4.3.7 12146 12148 eslint: 9.12.0(jiti@1.21.6) 12147 12149 optionalDependencies: ··· 12149 12151 transitivePeerDependencies: 12150 12152 - supports-color 12151 12153 12154 + '@typescript-eslint/scope-manager@8.10.0': 12155 + dependencies: 12156 + '@typescript-eslint/types': 8.10.0 12157 + '@typescript-eslint/visitor-keys': 8.10.0 12158 + 12152 12159 '@typescript-eslint/scope-manager@8.8.1': 12153 12160 dependencies: 12154 12161 '@typescript-eslint/types': 8.8.1 12155 12162 '@typescript-eslint/visitor-keys': 8.8.1 12156 12163 12157 - '@typescript-eslint/type-utils@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12164 + '@typescript-eslint/type-utils@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12158 12165 dependencies: 12159 - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.6.3) 12160 - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12166 + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) 12167 + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12161 12168 debug: 4.3.7 12162 12169 ts-api-utils: 1.3.0(typescript@5.6.3) 12163 12170 optionalDependencies: ··· 12166 12173 - eslint 12167 12174 - supports-color 12168 12175 12176 + '@typescript-eslint/types@8.10.0': {} 12177 + 12169 12178 '@typescript-eslint/types@8.8.1': {} 12179 + 12180 + '@typescript-eslint/typescript-estree@8.10.0(typescript@5.6.3)': 12181 + dependencies: 12182 + '@typescript-eslint/types': 8.10.0 12183 + '@typescript-eslint/visitor-keys': 8.10.0 12184 + debug: 4.3.7 12185 + fast-glob: 3.3.2 12186 + is-glob: 4.0.3 12187 + minimatch: 9.0.5 12188 + semver: 7.6.3 12189 + ts-api-utils: 1.3.0(typescript@5.6.3) 12190 + optionalDependencies: 12191 + typescript: 5.6.3 12192 + transitivePeerDependencies: 12193 + - supports-color 12170 12194 12171 12195 '@typescript-eslint/typescript-estree@8.8.1(typescript@5.6.3)': 12172 12196 dependencies: ··· 12183 12207 transitivePeerDependencies: 12184 12208 - supports-color 12185 12209 12210 + '@typescript-eslint/utils@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12211 + dependencies: 12212 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0(jiti@1.21.6)) 12213 + '@typescript-eslint/scope-manager': 8.10.0 12214 + '@typescript-eslint/types': 8.10.0 12215 + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) 12216 + eslint: 9.12.0(jiti@1.21.6) 12217 + transitivePeerDependencies: 12218 + - supports-color 12219 + - typescript 12220 + 12186 12221 '@typescript-eslint/utils@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)': 12187 12222 dependencies: 12188 12223 '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0(jiti@1.21.6)) ··· 12193 12228 transitivePeerDependencies: 12194 12229 - supports-color 12195 12230 - typescript 12231 + 12232 + '@typescript-eslint/visitor-keys@8.10.0': 12233 + dependencies: 12234 + '@typescript-eslint/types': 8.10.0 12235 + eslint-visitor-keys: 3.4.3 12196 12236 12197 12237 '@typescript-eslint/visitor-keys@8.8.1': 12198 12238 dependencies: ··· 12389 12429 vite: 5.4.0(@types/node@22.7.5)(terser@5.34.1) 12390 12430 vue: 3.5.12(typescript@5.6.3) 12391 12431 12392 - '@vitest/eslint-plugin@1.1.7(@typescript-eslint/utils@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)(vitest@packages+vitest)': 12432 + '@vitest/eslint-plugin@1.1.7(@typescript-eslint/utils@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3)(vitest@packages+vitest)': 12393 12433 dependencies: 12394 - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12434 + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 12395 12435 eslint: 9.12.0(jiti@1.21.6) 12396 12436 optionalDependencies: 12397 12437 typescript: 5.6.3 ··· 13284 13324 13285 13325 character-entities-html4@2.1.0: {} 13286 13326 13287 - character-entities-legacy@1.1.4: {} 13288 - 13289 13327 character-entities-legacy@3.0.0: {} 13290 13328 13291 - character-entities@1.2.4: {} 13292 - 13293 13329 character-entities@2.0.2: {} 13294 - 13295 - character-reference-invalid@1.1.4: {} 13296 13330 13297 13331 chardet@0.7.0: {} 13298 13332 ··· 14179 14213 eslint: 9.12.0(jiti@1.21.6) 14180 14214 find-up-simple: 1.0.0 14181 14215 14182 - eslint-flat-config-utils@0.3.1: 14216 + eslint-flat-config-utils@0.4.0: 14183 14217 dependencies: 14184 - '@types/eslint': 9.6.1 14185 14218 pathe: 1.1.2 14186 14219 14187 14220 eslint-import-resolver-node@0.3.9: ··· 14230 14263 - supports-color 14231 14264 - typescript 14232 14265 14233 - eslint-plugin-jsdoc@50.4.0(eslint@9.12.0(jiti@1.21.6)): 14266 + eslint-plugin-jsdoc@50.4.3(eslint@9.12.0(jiti@1.21.6)): 14234 14267 dependencies: 14235 14268 '@es-joy/jsdoccomment': 0.49.0 14236 14269 are-docs-informative: 0.0.2 ··· 14258 14291 natural-compare: 1.4.0 14259 14292 synckit: 0.6.2 14260 14293 14261 - eslint-plugin-markdown@5.1.0(eslint@9.12.0(jiti@1.21.6)): 14262 - dependencies: 14263 - eslint: 9.12.0(jiti@1.21.6) 14264 - mdast-util-from-markdown: 0.8.5 14265 - transitivePeerDependencies: 14266 - - supports-color 14267 - 14268 14294 eslint-plugin-n@17.11.1(eslint@9.12.0(jiti@1.21.6)): 14269 14295 dependencies: 14270 14296 '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0(jiti@1.21.6)) ··· 14272 14298 eslint: 9.12.0(jiti@1.21.6) 14273 14299 eslint-plugin-es-x: 7.5.0(eslint@9.12.0(jiti@1.21.6)) 14274 14300 get-tsconfig: 4.8.1 14275 - globals: 15.9.0 14301 + globals: 15.11.0 14276 14302 ignore: 5.3.1 14277 14303 minimatch: 9.0.5 14278 14304 semver: 7.6.3 14279 14305 14280 14306 eslint-plugin-no-only-tests@3.3.0: {} 14281 14307 14282 - eslint-plugin-perfectionist@3.8.0(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vue-eslint-parser@9.4.3(eslint@9.12.0(jiti@1.21.6))): 14308 + eslint-plugin-perfectionist@3.9.1(eslint@9.12.0(jiti@1.21.6))(svelte@3.59.1)(typescript@5.6.3)(vue-eslint-parser@9.4.3(eslint@9.12.0(jiti@1.21.6))): 14283 14309 dependencies: 14284 - '@typescript-eslint/types': 8.8.1 14285 - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 14310 + '@typescript-eslint/types': 8.10.0 14311 + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 14286 14312 eslint: 9.12.0(jiti@1.21.6) 14287 14313 minimatch: 9.0.5 14288 14314 natural-compare-lite: 1.4.0 ··· 14314 14340 transitivePeerDependencies: 14315 14341 - supports-color 14316 14342 14317 - eslint-plugin-unicorn@55.0.0(eslint@9.12.0(jiti@1.21.6)): 14343 + eslint-plugin-unicorn@56.0.0(eslint@9.12.0(jiti@1.21.6)): 14318 14344 dependencies: 14319 14345 '@babel/helper-validator-identifier': 7.25.7 14320 14346 '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0(jiti@1.21.6)) ··· 14323 14349 core-js-compat: 3.38.1 14324 14350 eslint: 9.12.0(jiti@1.21.6) 14325 14351 esquery: 1.6.0 14326 - globals: 15.9.0 14352 + globals: 15.11.0 14327 14353 indent-string: 4.0.0 14328 14354 is-builtin-module: 3.2.1 14329 14355 jsesc: 3.0.2 ··· 14334 14360 semver: 7.6.3 14335 14361 strip-indent: 3.0.0 14336 14362 14337 - eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6)): 14363 + eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6)): 14338 14364 dependencies: 14339 14365 eslint: 9.12.0(jiti@1.21.6) 14340 14366 optionalDependencies: 14341 - '@typescript-eslint/eslint-plugin': 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 14367 + '@typescript-eslint/eslint-plugin': 8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.3) 14342 14368 14343 14369 eslint-plugin-vue@9.29.0(eslint@9.12.0(jiti@1.21.6)): 14344 14370 dependencies: ··· 15004 15030 15005 15031 globals@14.0.0: {} 15006 15032 15007 - globals@15.9.0: {} 15033 + globals@15.11.0: {} 15008 15034 15009 15035 globalthis@1.0.4: 15010 15036 dependencies: ··· 15352 15378 15353 15379 ipaddr.js@1.9.1: {} 15354 15380 15355 - is-alphabetical@1.0.4: {} 15356 - 15357 - is-alphanumerical@1.0.4: 15358 - dependencies: 15359 - is-alphabetical: 1.0.4 15360 - is-decimal: 1.0.4 15361 - 15362 15381 is-arguments@1.1.1: 15363 15382 dependencies: 15364 15383 call-bind: 1.0.5 ··· 15410 15429 dependencies: 15411 15430 has-tostringtag: 1.0.0 15412 15431 15413 - is-decimal@1.0.4: {} 15414 - 15415 15432 is-docker@2.2.1: {} 15416 15433 15417 15434 is-docker@3.0.0: {} ··· 15425 15442 is-glob@4.0.3: 15426 15443 dependencies: 15427 15444 is-extglob: 2.1.1 15428 - 15429 - is-hexadecimal@1.0.4: {} 15430 15445 15431 15446 is-inside-container@1.0.0: 15432 15447 dependencies: ··· 15967 15982 unist-util-is: 6.0.0 15968 15983 unist-util-visit-parents: 6.0.1 15969 15984 15970 - mdast-util-from-markdown@0.8.5: 15971 - dependencies: 15972 - '@types/mdast': 3.0.15 15973 - mdast-util-to-string: 2.0.0 15974 - micromark: 2.11.4 15975 - parse-entities: 2.0.0 15976 - unist-util-stringify-position: 2.0.3 15977 - transitivePeerDependencies: 15978 - - supports-color 15979 - 15980 15985 mdast-util-from-markdown@2.0.1: 15981 15986 dependencies: 15982 15987 '@types/mdast': 4.0.3 ··· 16079 16084 unist-util-visit: 5.0.0 16080 16085 zwitch: 2.0.4 16081 16086 16082 - mdast-util-to-string@2.0.0: {} 16083 - 16084 16087 mdast-util-to-string@4.0.0: 16085 16088 dependencies: 16086 16089 '@types/mdast': 4.0.3 ··· 16118 16121 micromark-util-resolve-all: 2.0.0 16119 16122 micromark-util-subtokenize: 2.0.0 16120 16123 micromark-util-symbol: 2.0.0 16124 + micromark-util-types: 2.0.0 16125 + 16126 + micromark-extension-gfm-autolink-literal@2.1.0: 16127 + dependencies: 16128 + micromark-util-character: 2.1.0 16129 + micromark-util-sanitize-uri: 2.0.0 16130 + micromark-util-symbol: 2.0.0 16131 + micromark-util-types: 2.0.0 16132 + 16133 + micromark-extension-gfm-footnote@2.1.0: 16134 + dependencies: 16135 + devlop: 1.1.0 16136 + micromark-core-commonmark: 2.0.0 16137 + micromark-factory-space: 2.0.0 16138 + micromark-util-character: 2.1.0 16139 + micromark-util-normalize-identifier: 2.0.0 16140 + micromark-util-sanitize-uri: 2.0.0 16141 + micromark-util-symbol: 2.0.0 16142 + micromark-util-types: 2.0.0 16143 + 16144 + micromark-extension-gfm-strikethrough@2.1.0: 16145 + dependencies: 16146 + devlop: 1.1.0 16147 + micromark-util-chunked: 2.0.0 16148 + micromark-util-classify-character: 2.0.0 16149 + micromark-util-resolve-all: 2.0.0 16150 + micromark-util-symbol: 2.0.0 16151 + micromark-util-types: 2.0.0 16152 + 16153 + micromark-extension-gfm-table@2.1.0: 16154 + dependencies: 16155 + devlop: 1.1.0 16156 + micromark-factory-space: 2.0.0 16157 + micromark-util-character: 2.1.0 16158 + micromark-util-symbol: 2.0.0 16159 + micromark-util-types: 2.0.0 16160 + 16161 + micromark-extension-gfm-tagfilter@2.0.0: 16162 + dependencies: 16163 + micromark-util-types: 2.0.0 16164 + 16165 + micromark-extension-gfm-task-list-item@2.1.0: 16166 + dependencies: 16167 + devlop: 1.1.0 16168 + micromark-factory-space: 2.0.0 16169 + micromark-util-character: 2.1.0 16170 + micromark-util-symbol: 2.0.0 16171 + micromark-util-types: 2.0.0 16172 + 16173 + micromark-extension-gfm@3.0.0: 16174 + dependencies: 16175 + micromark-extension-gfm-autolink-literal: 2.1.0 16176 + micromark-extension-gfm-footnote: 2.1.0 16177 + micromark-extension-gfm-strikethrough: 2.1.0 16178 + micromark-extension-gfm-table: 2.1.0 16179 + micromark-extension-gfm-tagfilter: 2.0.0 16180 + micromark-extension-gfm-task-list-item: 2.1.0 16181 + micromark-util-combine-extensions: 2.0.0 16121 16182 micromark-util-types: 2.0.0 16122 16183 16123 16184 micromark-factory-destination@2.0.0: ··· 16211 16272 micromark-util-symbol@2.0.0: {} 16212 16273 16213 16274 micromark-util-types@2.0.0: {} 16214 - 16215 - micromark@2.11.4: 16216 - dependencies: 16217 - debug: 4.3.7 16218 - parse-entities: 2.0.0 16219 - transitivePeerDependencies: 16220 - - supports-color 16221 16275 16222 16276 micromark@4.0.0: 16223 16277 dependencies: ··· 16616 16670 16617 16671 parse-code-context@1.0.0: {} 16618 16672 16619 - parse-entities@2.0.0: 16620 - dependencies: 16621 - character-entities: 1.2.4 16622 - character-entities-legacy: 1.1.4 16623 - character-reference-invalid: 1.1.4 16624 - is-alphanumerical: 1.0.4 16625 - is-decimal: 1.0.4 16626 - is-hexadecimal: 1.0.4 16627 - 16628 16673 parse-gitignore@2.0.0: {} 16629 16674 16630 16675 parse-imports@2.1.1: ··· 16705 16750 picocolors@1.0.1: {} 16706 16751 16707 16752 picocolors@1.1.0: {} 16753 + 16754 + picocolors@1.1.1: {} 16708 16755 16709 16756 picomatch@2.3.1: {} 16710 16757 ··· 17921 17968 fdir: 6.4.0(picomatch@4.0.2) 17922 17969 picomatch: 4.0.2 17923 17970 17924 - tinyhighlight@0.3.2(picocolors@1.1.0): 17971 + tinyhighlight@0.3.2(picocolors@1.1.1): 17925 17972 dependencies: 17926 17973 js-tokens: 8.0.2 17927 17974 optionalDependencies: 17928 - picocolors: 1.1.0 17975 + picocolors: 1.1.1 17929 17976 17930 17977 tinypool@1.0.1: {} 17931 17978 ··· 18197 18244 unist-util-position@5.0.0: 18198 18245 dependencies: 18199 18246 '@types/unist': 3.0.2 18200 - 18201 - unist-util-stringify-position@2.0.3: 18202 - dependencies: 18203 - '@types/unist': 2.0.11 18204 18247 18205 18248 unist-util-stringify-position@4.0.0: 18206 18249 dependencies:
+3 -3
docs/vite.config.ts
··· 1 1 import type { Plugin } from 'vite' 2 - import { defineConfig } from 'vite' 3 - import Components from 'unplugin-vue-components/vite' 4 - import Unocss from 'unocss/vite' 5 2 import { presetAttributify, presetIcons, presetUno } from 'unocss' 3 + import Unocss from 'unocss/vite' 4 + import Components from 'unplugin-vue-components/vite' 5 + import { defineConfig } from 'vite' 6 6 7 7 export default defineConfig({ 8 8 optimizeDeps: {
+3 -3
docs/.vitepress/config.ts
··· 1 - import { defineConfig } from 'vitepress' 2 - import { withPwa } from '@vite-pwa/vitepress' 3 1 import { transformerTwoslash } from '@shikijs/vitepress-twoslash' 2 + import { withPwa } from '@vite-pwa/vitepress' 3 + import { defineConfig } from 'vitepress' 4 4 import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' 5 5 import { version } from '../../package.json' 6 + import { teamMembers } from './contributors' 6 7 import { 7 8 contributing, 8 9 discord, ··· 18 19 } from './meta' 19 20 import { pwa } from './scripts/pwa' 20 21 import { transformHead } from './scripts/transformHead' 21 - import { teamMembers } from './contributors' 22 22 23 23 export default ({ mode }: { mode: string }) => { 24 24 return withPwa(defineConfig({
+1 -1
docs/.vitepress/contributors.ts
··· 164 164 const teamMembers = plainTeamMembers.map(tm => createLinks(tm)) 165 165 const teamEmeritiMembers = plainTeamEmeritiMembers.map(tm => createLinks(tm)) 166 166 167 - export { teamMembers, teamEmeritiMembers } 167 + export { teamEmeritiMembers, teamMembers }
+1 -1
docs/advanced/pool.md
··· 65 65 ```ts 66 66 import { createBirpc } from 'birpc' 67 67 import { parse, stringify } from 'flatted' 68 - import { WorkspaceProject, createMethodsRPC } from 'vitest/node' 68 + import { createMethodsRPC, WorkspaceProject } from 'vitest/node' 69 69 70 70 function createRpc(project: WorkspaceProject, wss: WebSocketServer) { 71 71 return createBirpc(
+1 -1
docs/advanced/runner.md
··· 250 250 // ./utils/custom.js 251 251 import { createTaskCollector, getCurrentSuite, setFn } from 'vitest/suite' 252 252 253 - export { describe, beforeAll, afterAll } from 'vitest' 253 + export { afterAll, beforeAll, describe } from 'vitest' 254 254 255 255 // this function will be called during collection phase: 256 256 // don't call function handler here, add it to suite tasks
+1 -1
docs/guide/mocking.md
··· 443 443 ```js 444 444 import { afterAll, afterEach, beforeAll } from 'vitest' 445 445 import { setupServer } from 'msw/node' 446 - import { HttpResponse, graphql, http } from 'msw' 446 + import { graphql, http, HttpResponse } from 'msw' 447 447 448 448 const posts = [ 449 449 {
+3 -3
packages/browser/rollup.config.js
··· 1 1 import { createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 - import resolve from '@rollup/plugin-node-resolve' 5 2 import commonjs from '@rollup/plugin-commonjs' 6 3 import json from '@rollup/plugin-json' 4 + import resolve from '@rollup/plugin-node-resolve' 7 5 import { defineConfig } from 'rollup' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+2 -2
packages/coverage-istanbul/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 2 import commonjs from '@rollup/plugin-commonjs' 5 3 import json from '@rollup/plugin-json' 6 4 import nodeResolve from '@rollup/plugin-node-resolve' 7 5 import { join } from 'pathe' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+2 -2
packages/coverage-v8/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 2 import commonjs from '@rollup/plugin-commonjs' 5 3 import json from '@rollup/plugin-json' 6 4 import nodeResolve from '@rollup/plugin-node-resolve' 7 5 import { join } from 'pathe' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+1 -1
packages/expect/README.md
··· 5 5 ## Usage 6 6 7 7 ```js 8 - import * as chai from 'chai' 9 8 import { 10 9 JestAsymmetricMatchers, 11 10 JestChaiExpect, 12 11 JestExtend, 13 12 } from '@vitest/expect' 13 + import * as chai from 'chai' 14 14 15 15 // allows using expect.extend instead of chai.use to extend plugins 16 16 chai.use(JestExtend)
+2 -2
packages/expect/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 2 import { defineConfig } from 'rollup' 5 3 import copy from 'rollup-plugin-copy' 4 + import dts from 'rollup-plugin-dts' 5 + import esbuild from 'rollup-plugin-esbuild' 6 6 7 7 const require = createRequire(import.meta.url) 8 8 const pkg = require('./package.json')
+5 -5
packages/mocker/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import { defineConfig } from 'rollup' 3 - import esbuild from 'rollup-plugin-esbuild' 4 - import dts from 'rollup-plugin-dts' 5 - import resolve from '@rollup/plugin-node-resolve' 6 - import json from '@rollup/plugin-json' 7 2 import commonjs from '@rollup/plugin-commonjs' 3 + import json from '@rollup/plugin-json' 4 + import resolve from '@rollup/plugin-node-resolve' 5 + import { defineConfig } from 'rollup' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+5 -5
packages/pretty-format/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import { defineConfig } from 'rollup' 3 - import esbuild from 'rollup-plugin-esbuild' 4 - import dts from 'rollup-plugin-dts' 5 - import resolve from '@rollup/plugin-node-resolve' 6 - import json from '@rollup/plugin-json' 7 2 import commonjs from '@rollup/plugin-commonjs' 3 + import json from '@rollup/plugin-json' 4 + import resolve from '@rollup/plugin-node-resolve' 5 + import { defineConfig } from 'rollup' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+2 -2
packages/runner/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 2 import json from '@rollup/plugin-json' 4 - import dts from 'rollup-plugin-dts' 5 3 import { defineConfig } from 'rollup' 4 + import dts from 'rollup-plugin-dts' 5 + import esbuild from 'rollup-plugin-esbuild' 6 6 7 7 const require = createRequire(import.meta.url) 8 8 const pkg = require('./package.json')
+3 -3
packages/snapshot/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import nodeResolve from '@rollup/plugin-node-resolve' 4 - import dts from 'rollup-plugin-dts' 5 2 import commonjs from '@rollup/plugin-commonjs' 3 + import nodeResolve from '@rollup/plugin-node-resolve' 6 4 import { defineConfig } from 'rollup' 5 + import dts from 'rollup-plugin-dts' 6 + import esbuild from 'rollup-plugin-esbuild' 7 7 8 8 const require = createRequire(import.meta.url) 9 9 const pkg = require('./package.json')
+2 -2
packages/spy/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 2 import { defineConfig } from 'rollup' 3 + import dts from 'rollup-plugin-dts' 4 + import esbuild from 'rollup-plugin-esbuild' 5 5 6 6 const require = createRequire(import.meta.url) 7 7 const pkg = require('./package.json')
+3 -3
packages/ui/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 - import resolve from '@rollup/plugin-node-resolve' 5 2 import commonjs from '@rollup/plugin-commonjs' 6 3 import json from '@rollup/plugin-json' 4 + import resolve from '@rollup/plugin-node-resolve' 5 + import dts from 'rollup-plugin-dts' 6 + import esbuild from 'rollup-plugin-esbuild' 7 7 8 8 const require = createRequire(import.meta.url) 9 9 const pkg = require('./package.json')
+6 -6
packages/ui/vite.config.ts
··· 1 - import { resolve } from 'pathe' 2 1 import type { UserConfig } from 'vite' 3 - import { defineConfig } from 'vite' 4 2 import Vue from '@vitejs/plugin-vue' 5 - import Components from 'unplugin-vue-components/vite' 6 - import AutoImport from 'unplugin-auto-import/vite' 7 - import Unocss from 'unocss/vite' 8 - import Pages from 'vite-plugin-pages' 3 + import { resolve } from 'pathe' 9 4 import { presetAttributify, presetIcons, presetUno, transformerDirectives } from 'unocss' 5 + import Unocss from 'unocss/vite' 6 + import AutoImport from 'unplugin-auto-import/vite' 7 + import Components from 'unplugin-vue-components/vite' 8 + import { defineConfig } from 'vite' 9 + import Pages from 'vite-plugin-pages' 10 10 11 11 // for debug: 12 12 // open a static file serve to share the report json
+5 -5
packages/utils/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import { defineConfig } from 'rollup' 3 - import esbuild from 'rollup-plugin-esbuild' 4 - import dts from 'rollup-plugin-dts' 5 - import resolve from '@rollup/plugin-node-resolve' 6 - import json from '@rollup/plugin-json' 7 2 import commonjs from '@rollup/plugin-commonjs' 3 + import json from '@rollup/plugin-json' 4 + import resolve from '@rollup/plugin-node-resolve' 5 + import { defineConfig } from 'rollup' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+1 -1
packages/vite-node/README.md
··· 83 83 84 84 ```ts 85 85 import { createServer } from 'vite' 86 - import { ViteNodeServer } from 'vite-node/server' 87 86 import { ViteNodeRunner } from 'vite-node/client' 87 + import { ViteNodeServer } from 'vite-node/server' 88 88 import { installSourcemapsSupport } from 'vite-node/source-map' 89 89 90 90 // create vite server
+3 -3
packages/vite-node/rollup.config.js
··· 1 1 import { builtinModules, createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 - import resolve from '@rollup/plugin-node-resolve' 5 2 import commonjs from '@rollup/plugin-commonjs' 6 3 import json from '@rollup/plugin-json' 4 + import resolve from '@rollup/plugin-node-resolve' 7 5 import { defineConfig } from 'rollup' 6 + import dts from 'rollup-plugin-dts' 7 + import esbuild from 'rollup-plugin-esbuild' 8 8 9 9 const require = createRequire(import.meta.url) 10 10 const pkg = require('./package.json')
+6 -6
packages/vitest/rollup.config.js
··· 1 1 import fs from 'node:fs' 2 2 import { builtinModules, createRequire } from 'node:module' 3 3 import { fileURLToPath } from 'node:url' 4 - import { dirname, join, normalize, resolve } from 'pathe' 5 - import esbuild from 'rollup-plugin-esbuild' 6 - import dts from 'rollup-plugin-dts' 7 - import nodeResolve from '@rollup/plugin-node-resolve' 8 4 import commonjs from '@rollup/plugin-commonjs' 9 5 import json from '@rollup/plugin-json' 10 - import license from 'rollup-plugin-license' 6 + import nodeResolve from '@rollup/plugin-node-resolve' 11 7 import fg from 'fast-glob' 12 - import c from 'tinyrainbow' 8 + import { dirname, join, normalize, resolve } from 'pathe' 13 9 import { defineConfig } from 'rollup' 10 + import dts from 'rollup-plugin-dts' 11 + import esbuild from 'rollup-plugin-esbuild' 12 + import license from 'rollup-plugin-license' 13 + import c from 'tinyrainbow' 14 14 15 15 const require = createRequire(import.meta.url) 16 16 const pkg = require('./package.json')
+3 -3
packages/web-worker/rollup.config.js
··· 1 1 import { createRequire } from 'node:module' 2 - import esbuild from 'rollup-plugin-esbuild' 3 - import dts from 'rollup-plugin-dts' 4 2 import commonjs from '@rollup/plugin-commonjs' 5 - import nodeResolve from '@rollup/plugin-node-resolve' 6 3 import json from '@rollup/plugin-json' 4 + import nodeResolve from '@rollup/plugin-node-resolve' 5 + import dts from 'rollup-plugin-dts' 6 + import esbuild from 'rollup-plugin-esbuild' 7 7 8 8 const require = createRequire(import.meta.url) 9 9 const pkg = require('./package.json')
+3 -3
packages/ws-client/rollup.config.js
··· 1 - import esbuild from 'rollup-plugin-esbuild' 2 - import dts from 'rollup-plugin-dts' 3 - import resolve from '@rollup/plugin-node-resolve' 4 1 import commonjs from '@rollup/plugin-commonjs' 5 2 import json from '@rollup/plugin-json' 3 + import resolve from '@rollup/plugin-node-resolve' 4 + import dts from 'rollup-plugin-dts' 5 + import esbuild from 'rollup-plugin-esbuild' 6 6 7 7 const entry = ['src/index.ts'] 8 8
+1 -1
test/browser/vitest.config.mts
··· 1 + import type { BrowserCommand } from 'vitest/node' 1 2 import { dirname, resolve } from 'node:path' 2 3 import { fileURLToPath } from 'node:url' 3 4 import * as util from 'node:util' 4 5 import { defineConfig } from 'vitest/config' 5 - import type { BrowserCommand } from 'vitest/node' 6 6 7 7 const dir = dirname(fileURLToPath(import.meta.url)) 8 8
+1 -1
test/cli/custom.ts
··· 1 + import type { Environment } from 'vitest' 1 2 import vm from 'node:vm' 2 3 import debug from 'debug' 3 - import type { Environment } from 'vitest' 4 4 5 5 // test that external packages (debug) are loaded correctly 6 6 const log = debug('test:env')
+4 -4
test/coverage-test/utils.ts
··· 1 + import type { FileCoverageData } from 'istanbul-lib-coverage' 2 + import type { TestFunction } from 'vitest' 3 + import type { UserConfig } from 'vitest/node' 1 4 import { readFileSync } from 'node:fs' 2 5 import { resolve } from 'node:path' 3 6 import { fileURLToPath } from 'node:url' 4 7 import { stripVTControlCharacters } from 'node:util' 5 - import { normalize } from 'pathe' 6 8 import libCoverage from 'istanbul-lib-coverage' 7 - import type { FileCoverageData } from 'istanbul-lib-coverage' 8 - import type { TestFunction } from 'vitest' 9 + import { normalize } from 'pathe' 9 10 import { vi, describe as vitestDescribe, test as vitestTest } from 'vitest' 10 - import type { UserConfig } from 'vitest/node' 11 11 import * as testUtils from '../test-utils' 12 12 13 13 export function test(name: string, fn: TestFunction, skip = false) {
+1 -1
test/public-mocker/vite.config.ts
··· 1 - import { defineConfig } from 'vite' 2 1 import { mockerPlugin } from '@vitest/mocker/node' 2 + import { defineConfig } from 'vite' 3 3 4 4 export default defineConfig({ 5 5 root: 'fixtures/redirect',
+8 -8
test/test-utils/index.ts
··· 1 - import { Readable, Writable } from 'node:stream' 2 - import fs from 'node:fs' 3 - import { fileURLToPath } from 'node:url' 4 - import type { UserConfig as ViteUserConfig } from 'vite' 5 - import { type WorkerGlobalState, afterEach, onTestFinished } from 'vitest' 6 - import type { UserConfig, Vitest, VitestRunMode } from 'vitest/node' 7 - import { startVitest } from 'vitest/node' 8 1 import type { Options } from 'tinyexec' 9 - import { x } from 'tinyexec' 2 + import type { UserConfig as ViteUserConfig } from 'vite' 3 + import type { UserConfig, Vitest, VitestRunMode } from 'vitest/node' 4 + import fs from 'node:fs' 5 + import { Readable, Writable } from 'node:stream' 6 + import { fileURLToPath } from 'node:url' 10 7 import { dirname, resolve } from 'pathe' 8 + import { x } from 'tinyexec' 9 + import { afterEach, onTestFinished, type WorkerGlobalState } from 'vitest' 10 + import { startVitest } from 'vitest/node' 11 11 import { getCurrentTest } from 'vitest/suite' 12 12 import { Cli } from './cli' 13 13
+1 -1
test/workspaces-browser/globalTest.ts
··· 1 - import { readFile } from 'node:fs/promises' 2 1 import assert from 'node:assert/strict' 2 + import { readFile } from 'node:fs/promises' 3 3 4 4 let teardownCalled = false 5 5
+2 -2
test/workspaces/globalTest.ts
··· 1 - import { readFile } from 'node:fs/promises' 2 - import assert from 'node:assert/strict' 3 1 import type { GlobalSetupContext } from 'vitest/node' 2 + import assert from 'node:assert/strict' 3 + import { readFile } from 'node:fs/promises' 4 4 5 5 declare module 'vitest' { 6 6 interface ProvidedContext {
+3 -3
test/workspaces/vitest.workspace.ts
··· 1 - import { defineWorkspace } from 'vitest/config' 2 - import MagicString from 'magic-string' 3 - import remapping from '@ampproject/remapping' 4 1 import type { Plugin } from 'vite' 2 + import remapping from '@ampproject/remapping' 3 + import MagicString from 'magic-string' 4 + import { defineWorkspace } from 'vitest/config' 5 5 6 6 export default defineWorkspace([ 7 7 'space_2',
+1 -1
docs/.vitepress/components/ListItem.vue
··· 1 1 <script setup lang="ts"> 2 - import { computed, effectScope, onMounted, ref } from 'vue' 3 2 import { until, useElementVisibility } from '@vueuse/core' 3 + import { computed, effectScope, onMounted, ref } from 'vue' 4 4 5 5 const el = ref<HTMLDivElement>() 6 6 const state = ref(0)
+1 -1
docs/.vitepress/scripts/cli-generator.ts
··· 1 + import type { CLIOption, CLIOptions } from '../../../packages/vitest/src/node/cli/cli-config' 1 2 import { writeFileSync } from 'node:fs' 2 3 import { dirname, resolve } from 'node:path' 3 4 import { fileURLToPath } from 'node:url' 4 - import type { CLIOption, CLIOptions } from '../../../packages/vitest/src/node/cli/cli-config' 5 5 import { cliOptionsConfig } from '../../../packages/vitest/src/node/cli/cli-config' 6 6 7 7 const docsDir = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
+1 -1
docs/.vitepress/scripts/fetch-avatars.ts
··· 11 11 if (existsSync(fileName)) { 12 12 return 13 13 } 14 - // eslint-disable-next-line no-console 14 + 15 15 console.log('downloading', fileName) 16 16 try { 17 17 const image = await (await fetch(url)).arrayBuffer()
+1 -1
docs/.vitepress/scripts/pwa.ts
··· 1 1 import type { PwaOptions } from '@vite-pwa/vitepress' 2 2 import { 3 3 githubusercontentRegex, 4 - pwaFontStylesRegex, 5 4 pwaFontsRegex, 5 + pwaFontStylesRegex, 6 6 vitestDescription, 7 7 vitestName, 8 8 vitestShortName,
+6 -6
docs/.vitepress/theme/index.ts
··· 1 - import { h } from 'vue' 2 1 import type { Theme } from 'vitepress' 3 - import DefaultTheme from 'vitepress/theme' 2 + import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client' 4 3 import { inBrowser } from 'vitepress' 4 + import DefaultTheme from 'vitepress/theme' 5 + import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' 6 + import { h } from 'vue' 7 + import HomePage from '../components/HomePage.vue' 8 + import Version from '../components/Version.vue' 5 9 import '../style/main.css' 6 10 import '../style/vars.css' 7 11 import 'uno.css' 8 - import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client' 9 - import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' 10 - import HomePage from '../components/HomePage.vue' 11 - import Version from '../components/Version.vue' 12 12 import '@shikijs/vitepress-twoslash/style.css' 13 13 14 14 if (inBrowser) {
+2 -2
examples/fastify/test/app.test.ts
··· 1 - import { afterAll, expect, test } from 'vitest' 2 1 import supertest from 'supertest' 2 + import { afterAll, expect, test } from 'vitest' 3 3 4 - import app from '../src/app' 5 4 import { usersData } from '../mockData' 5 + import app from '../src/app' 6 6 7 7 test('with HTTP injection', async () => { 8 8 const response = await app.inject({
+1 -1
examples/lit/src/my-button.ts
··· 1 - import { LitElement, css, html } from 'lit' 1 + import { css, html, LitElement } from 'lit' 2 2 import { customElement, property } from 'lit/decorators.js' 3 3 4 4 /**
+1 -1
examples/lit/test/basic.test.ts
··· 1 - import { beforeEach, describe, expect, it } from 'vitest' 2 1 import { page } from '@vitest/browser/context' 2 + import { beforeEach, describe, expect, it } from 'vitest' 3 3 4 4 import '../src/my-button.js' 5 5
+1 -1
packages/coverage-istanbul/src/index.ts
··· 1 - import { COVERAGE_STORE_KEY } from './constants' 2 1 import type { IstanbulCoverageProvider } from './provider' 2 + import { COVERAGE_STORE_KEY } from './constants' 3 3 4 4 export async function getProvider(): Promise<IstanbulCoverageProvider> { 5 5 // to not bundle the provider
+9 -9
packages/coverage-istanbul/src/provider.ts
··· 1 - import { promises as fs } from 'node:fs' 2 - import { resolve } from 'pathe' 3 1 import type { CoverageProvider, ReportContext, ResolvedCoverageOptions, Vitest } from 'vitest/node' 4 - import { BaseCoverageProvider } from 'vitest/coverage' 5 - import c from 'tinyrainbow' 6 - import { parseModule } from 'magicast' 2 + import { promises as fs } from 'node:fs' 7 3 import createDebug from 'debug' 8 - import TestExclude from 'test-exclude' 9 - import libReport from 'istanbul-lib-report' 10 - import reports from 'istanbul-reports' 11 4 import libCoverage, { type CoverageMap } from 'istanbul-lib-coverage' 5 + import { createInstrumenter, type Instrumenter } from 'istanbul-lib-instrument' 6 + import libReport from 'istanbul-lib-report' 12 7 import libSourceMaps from 'istanbul-lib-source-maps' 13 - import { type Instrumenter, createInstrumenter } from 'istanbul-lib-instrument' 8 + import reports from 'istanbul-reports' 9 + import { parseModule } from 'magicast' 10 + import { resolve } from 'pathe' 11 + import TestExclude from 'test-exclude' 12 + import c from 'tinyrainbow' 13 + import { BaseCoverageProvider } from 'vitest/coverage' 14 14 // @ts-expect-error missing types 15 15 import { defaults as istanbulDefaults } from '@istanbuljs/schema' 16 16
+1 -1
packages/coverage-v8/src/browser.ts
··· 1 - import { cdp } from '@vitest/browser/context' 2 1 import type { V8CoverageProvider } from './provider' 2 + import { cdp } from '@vitest/browser/context' 3 3 import { loadProvider } from './load-provider' 4 4 5 5 const session = cdp()
+1 -1
packages/coverage-v8/src/index.ts
··· 1 + import type { V8CoverageProvider } from './provider' 1 2 import inspector, { type Profiler } from 'node:inspector' 2 3 import { provider } from 'std-env' 3 - import type { V8CoverageProvider } from './provider' 4 4 import { loadProvider } from './load-provider' 5 5 6 6 const session = new inspector.Session()
+12 -12
packages/coverage-v8/src/provider.ts
··· 1 + import type { CoverageMap } from 'istanbul-lib-coverage' 1 2 import type { Profiler } from 'node:inspector' 2 - import { fileURLToPath, pathToFileURL } from 'node:url' 3 + import type { EncodedSourceMap, FetchResult } from 'vite-node' 4 + import type { AfterSuiteRunMeta } from 'vitest' 5 + import type { CoverageProvider, ReportContext, ResolvedCoverageOptions, Vitest, WorkspaceProject } from 'vitest/node' 3 6 import { promises as fs } from 'node:fs' 4 - import v8ToIstanbul from 'v8-to-istanbul' 7 + import { fileURLToPath, pathToFileURL } from 'node:url' 8 + import remapping from '@ampproject/remapping' 5 9 import { mergeProcessCovs } from '@bcoe/v8-coverage' 10 + import createDebug from 'debug' 6 11 import libCoverage from 'istanbul-lib-coverage' 7 12 import libReport from 'istanbul-lib-report' 8 13 import libSourceMaps from 'istanbul-lib-source-maps' 9 14 import reports from 'istanbul-reports' 10 - import type { CoverageMap } from 'istanbul-lib-coverage' 15 + import MagicString from 'magic-string' 16 + import { parseModule } from 'magicast' 11 17 import { normalize, resolve } from 'pathe' 12 18 import { provider } from 'std-env' 13 - import c from 'tinyrainbow' 14 - import createDebug from 'debug' 15 - import MagicString from 'magic-string' 16 19 import TestExclude from 'test-exclude' 17 - import remapping from '@ampproject/remapping' 18 - import { BaseCoverageProvider } from 'vitest/coverage' 20 + import c from 'tinyrainbow' 21 + import v8ToIstanbul from 'v8-to-istanbul' 19 22 import { cleanUrl } from 'vite-node/utils' 20 - import type { AfterSuiteRunMeta } from 'vitest' 21 - import type { CoverageProvider, ReportContext, ResolvedCoverageOptions, Vitest, WorkspaceProject } from 'vitest/node' 22 - import type { EncodedSourceMap, FetchResult } from 'vite-node' 23 23 24 - import { parseModule } from 'magicast' 24 + import { BaseCoverageProvider } from 'vitest/coverage' 25 25 import { version } from '../package.json' with { type: 'json' } 26 26 27 27 type TransformResults = Map<string, FetchResult>
+5 -5
packages/expect/src/index.ts
··· 1 - export * from './jest-asymmetric-matchers' 2 - export * from './jest-utils' 3 1 export * from './constants' 4 - export * from './types' 5 - export { getState, setState } from './state' 2 + export * from './jest-asymmetric-matchers' 6 3 export { JestChaiExpect } from './jest-expect' 7 - export { addCustomEqualityTesters } from './jest-matcher-utils' 8 4 export { JestExtend } from './jest-extend' 5 + export { addCustomEqualityTesters } from './jest-matcher-utils' 6 + export * from './jest-utils' 7 + export { getState, setState } from './state' 8 + export * from './types'
+2 -2
packages/expect/src/jest-asymmetric-matchers.ts
··· 1 1 import type { ChaiPlugin, MatcherState } from './types' 2 2 import { GLOBAL_EXPECT } from './constants' 3 - import { getState } from './state' 4 3 import { 5 4 diff, 6 5 getCustomEqualityTesters, 7 6 getMatcherUtils, 8 7 stringify, 9 8 } from './jest-matcher-utils' 10 - 11 9 import { 12 10 equals, 13 11 isA, ··· 15 13 pluralize, 16 14 subsetEquality, 17 15 } from './jest-utils' 16 + 17 + import { getState } from './state' 18 18 19 19 export interface AsymmetricMatcherInterface { 20 20 asymmetricMatch: (other: unknown) => boolean
+12 -12
packages/expect/src/jest-expect.ts
··· 1 + import type { Test } from '@vitest/runner' 2 + import type { MockInstance, MockResult, MockSettledResult } from '@vitest/spy' 3 + import type { Constructable } from '@vitest/utils' 4 + import type { AsymmetricMatcher } from './jest-asymmetric-matchers' 5 + import type { Assertion, ChaiPlugin } from './types' 6 + import { isMockFunction } from '@vitest/spy' 1 7 import { assertTypes } from '@vitest/utils' 2 8 import c from 'tinyrainbow' 3 - import type { Constructable } from '@vitest/utils' 4 - import type { MockInstance, MockResult, MockSettledResult } from '@vitest/spy' 5 - import { isMockFunction } from '@vitest/spy' 6 - import type { Test } from '@vitest/runner' 7 - import type { Assertion, ChaiPlugin } from './types' 9 + import { JEST_MATCHERS_OBJECT } from './constants' 10 + import { 11 + diff, 12 + getCustomEqualityTesters, 13 + stringify, 14 + } from './jest-matcher-utils' 8 15 import { 9 16 arrayBufferEquality, 10 17 generateToBeMessage, ··· 15 22 subsetEquality, 16 23 typeEquality, 17 24 } from './jest-utils' 18 - import type { AsymmetricMatcher } from './jest-asymmetric-matchers' 19 - import { 20 - diff, 21 - getCustomEqualityTesters, 22 - stringify, 23 - } from './jest-matcher-utils' 24 - import { JEST_MATCHERS_OBJECT } from './constants' 25 25 import { recordAsyncExpect, wrapAssertion } from './utils' 26 26 27 27 // polyfill globals because expect can be used in node environment
+4 -4
packages/expect/src/jest-extend.ts
··· 1 - import { use, util } from 'chai' 2 1 import type { 3 2 ChaiPlugin, 4 3 ExpectStatic, 5 - MatcherState, 6 4 MatchersObject, 5 + MatcherState, 7 6 SyncExpectationResult, 8 7 } from './types' 8 + import { use, util } from 'chai' 9 9 import { ASYMMETRIC_MATCHERS_OBJECT, JEST_MATCHERS_OBJECT } from './constants' 10 10 import { AsymmetricMatcher } from './jest-asymmetric-matchers' 11 - import { getState } from './state' 12 - 13 11 import { 14 12 diff, 15 13 getCustomEqualityTesters, ··· 18 16 } from './jest-matcher-utils' 19 17 20 18 import { equals, iterableEquality, subsetEquality } from './jest-utils' 19 + 20 + import { getState } from './state' 21 21 import { wrapAssertion } from './utils' 22 22 23 23 function getMatcherState(
+3 -3
packages/expect/src/jest-matcher-utils.ts
··· 1 - import { getType, stringify } from '@vitest/utils' 2 - import c from 'tinyrainbow' 3 - import { diff, printDiffOrStringify } from '@vitest/utils/diff' 4 1 import type { MatcherHintOptions, Tester } from './types' 2 + import { getType, stringify } from '@vitest/utils' 3 + import { diff, printDiffOrStringify } from '@vitest/utils/diff' 4 + import c from 'tinyrainbow' 5 5 import { JEST_MATCHERS_OBJECT } from './constants' 6 6 7 7 export { diff } from '@vitest/utils/diff'
+1 -1
packages/expect/src/jest-utils.ts
··· 22 22 23 23 */ 24 24 25 - import { isObject } from '@vitest/utils' 26 25 import type { Tester, TesterContext } from './types' 26 + import { isObject } from '@vitest/utils' 27 27 28 28 // Extracted out of jasmine 2.5.2 29 29 export function equals(
+1 -1
packages/expect/src/types.ts
··· 6 6 * 7 7 */ 8 8 9 - import type { Formatter } from 'tinyrainbow' 10 9 import type { Constructable } from '@vitest/utils' 10 + import type { Formatter } from 'tinyrainbow' 11 11 import type { diff, getMatcherUtils, stringify } from './jest-matcher-utils' 12 12 13 13 export type ChaiPlugin = Chai.ChaiPlugin
+1 -1
packages/expect/src/utils.ts
··· 1 - import { processError } from '@vitest/utils/error' 2 1 import type { Test } from '@vitest/runner/types' 3 2 import type { Assertion } from './types' 3 + import { processError } from '@vitest/utils/error' 4 4 5 5 export function recordAsyncExpect( 6 6 test: any,
+10 -10
packages/mocker/src/index.ts
··· 1 + export { mockObject } from './automocker' 2 + export type { GlobalConstructors, MockObjectOptions } from './automocker' 3 + 1 4 export { 2 - MockerRegistry, 3 - ManualMockedModule, 4 - RedirectedModule, 5 5 AutomockedModule, 6 6 AutospiedModule, 7 + ManualMockedModule, 8 + MockerRegistry, 9 + RedirectedModule, 7 10 } from './registry' 8 - export { mockObject } from './automocker' 9 - 10 - export type { GlobalConstructors, MockObjectOptions } from './automocker' 11 11 export type { 12 - MockedModule, 13 - MockedModuleType, 14 - MockedModuleSerialized, 15 12 AutomockedModuleSerialized, 16 13 AutospiedModuleSerialized, 17 - RedirectedModuleSerialized, 18 14 ManualMockedModuleSerialized, 15 + MockedModule, 16 + MockedModuleSerialized, 17 + MockedModuleType, 18 + RedirectedModuleSerialized, 19 19 } from './registry' 20 20 21 21 export type {
+13 -13
packages/pretty-format/src/index.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 + import type { 9 + Colors, 10 + Config, 11 + NewPlugin, 12 + Options, 13 + OptionsReceived, 14 + Plugin, 15 + Plugins, 16 + Refs, 17 + Theme, 18 + } from './types' 8 19 import styles from 'tinyrainbow' 9 20 import { 10 21 printIteratorEntries, ··· 18 29 import Immutable from './plugins/Immutable' 19 30 import ReactElement from './plugins/ReactElement' 20 31 import ReactTestComponent from './plugins/ReactTestComponent' 21 - import type { 22 - Colors, 23 - Config, 24 - NewPlugin, 25 - Options, 26 - OptionsReceived, 27 - Plugin, 28 - Plugins, 29 - Refs, 30 - Theme, 31 - } from './types' 32 32 33 33 export type { 34 34 Colors, 35 35 CompareKeys, 36 36 Config, 37 + NewPlugin, 38 + OldPlugin, 37 39 Options, 38 40 OptionsReceived, 39 - OldPlugin, 40 - NewPlugin, 41 41 Plugin, 42 42 Plugins, 43 43 PrettyFormatOptions,
+11 -11
packages/runner/src/collect.ts
··· 1 - import { processError } from '@vitest/utils/error' 2 - import { toArray } from '@vitest/utils' 3 - import type { File, SuiteHooks } from './types/tasks' 4 1 import type { VitestRunner } from './types/runner' 2 + import type { File, SuiteHooks } from './types/tasks' 3 + import { toArray } from '@vitest/utils' 4 + import { processError } from '@vitest/utils/error' 5 + import { collectorContext } from './context' 6 + import { getHooks, setHooks } from './map' 7 + import { runSetupFiles } from './setup' 8 + import { 9 + clearCollectorContext, 10 + createSuiteHooks, 11 + getDefaultSuite, 12 + } from './suite' 5 13 import { 6 14 calculateSuiteHash, 7 15 createFileTask, 8 16 interpretTaskModes, 9 17 someTasksAreOnly, 10 18 } from './utils/collect' 11 - import { 12 - clearCollectorContext, 13 - createSuiteHooks, 14 - getDefaultSuite, 15 - } from './suite' 16 - import { getHooks, setHooks } from './map' 17 - import { collectorContext } from './context' 18 - import { runSetupFiles } from './setup' 19 19 20 20 const now = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now 21 21
+2 -2
packages/runner/src/context.ts
··· 1 1 import type { Awaitable } from '@vitest/utils' 2 - import { getSafeTimers } from '@vitest/utils' 2 + import type { VitestRunner } from './types/runner' 3 3 import type { 4 4 Custom, 5 5 ExtendedContext, ··· 8 8 TaskContext, 9 9 Test, 10 10 } from './types/tasks' 11 - import type { VitestRunner } from './types/runner' 11 + import { getSafeTimers } from '@vitest/utils' 12 12 import { PendingError } from './errors' 13 13 14 14 export const collectorContext: RuntimeContext = {
+1 -1
packages/runner/src/fixture.ts
··· 1 + import type { FixtureOptions, TestContext } from './types/tasks' 1 2 import { createDefer, isObject } from '@vitest/utils' 2 3 import { getFixture } from './map' 3 - import type { FixtureOptions, TestContext } from './types/tasks' 4 4 5 5 export interface FixtureItem extends FixtureOptions { 6 6 prop: string
+3 -3
packages/runner/src/hooks.ts
··· 1 - import { assertTypes } from '@vitest/utils' 2 1 import type { 3 2 AfterAllListener, 4 3 AfterEachListener, ··· 9 8 TaskHook, 10 9 TaskPopulated, 11 10 } from './types/tasks' 12 - import { getCurrentSuite, getRunner } from './suite' 13 - import { getCurrentTest } from './test-state' 11 + import { assertTypes } from '@vitest/utils' 14 12 import { withTimeout } from './context' 15 13 import { withFixtures } from './fixture' 14 + import { getCurrentSuite, getRunner } from './suite' 15 + import { getCurrentTest } from './test-state' 16 16 17 17 function getDefaultHookTimeout() { 18 18 return getRunner().config.hookTimeout
+14 -14
packages/runner/src/index.ts
··· 1 - export { startTests, updateTask, collectTests } from './run' 2 1 export { 3 - test, 4 - it, 5 - describe, 6 - suite, 7 - getCurrentSuite, 8 - createTaskCollector, 9 - } from './suite' 10 - export { 11 - beforeAll, 12 - beforeEach, 13 2 afterAll, 14 3 afterEach, 4 + beforeAll, 5 + beforeEach, 15 6 onTestFailed, 16 7 onTestFinished, 17 8 } from './hooks' 18 - export { setFn, getFn, getHooks, setHooks } from './map' 9 + export { getFn, getHooks, setFn, setHooks } from './map' 10 + export { collectTests, startTests, updateTask } from './run' 11 + export { 12 + createTaskCollector, 13 + describe, 14 + getCurrentSuite, 15 + it, 16 + suite, 17 + test, 18 + } from './suite' 19 19 export { getCurrentTest } from './test-state' 20 - export { processError } from '@vitest/utils/error' 21 - 22 20 export type * from './types' 21 + 22 + export { processError } from '@vitest/utils/error'
+1 -1
packages/runner/src/map.ts
··· 1 1 import type { Awaitable } from '@vitest/utils' 2 - import type { Custom, Suite, SuiteHooks, Test, TestContext } from './types/tasks' 3 2 import type { FixtureItem } from './fixture' 3 + import type { Custom, Suite, SuiteHooks, Test, TestContext } from './types/tasks' 4 4 5 5 // use WeakMap here to make the Test and Suite object serializable 6 6 const fnMap = new WeakMap()
+7 -7
packages/runner/src/run.ts
··· 1 1 import type { Awaitable } from '@vitest/utils' 2 - import { getSafeTimers, shuffle } from '@vitest/utils' 3 - import { processError } from '@vitest/utils/error' 4 2 import type { DiffOptions } from '@vitest/utils/diff' 5 3 import type { VitestRunner } from './types/runner' 6 4 import type { ··· 18 16 TaskState, 19 17 Test, 20 18 } from './types/tasks' 21 - import { partitionSuiteChildren } from './utils/suite' 22 - import { limitConcurrency } from './utils/limit-concurrency' 23 - import { getFn, getHooks } from './map' 19 + import { getSafeTimers, shuffle } from '@vitest/utils' 20 + import { processError } from '@vitest/utils/error' 24 21 import { collectTests } from './collect' 25 - import { setCurrentTest } from './test-state' 26 - import { hasFailed, hasTests } from './utils/tasks' 27 22 import { PendingError } from './errors' 28 23 import { callFixtureCleanup } from './fixture' 24 + import { getFn, getHooks } from './map' 25 + import { setCurrentTest } from './test-state' 26 + import { limitConcurrency } from './utils/limit-concurrency' 27 + import { partitionSuiteChildren } from './utils/suite' 28 + import { hasFailed, hasTests } from './utils/tasks' 29 29 30 30 const now = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now 31 31 const unixNow = Date.now
+14 -15
packages/runner/src/suite.ts
··· 1 - import { 2 - format, 3 - isNegativeNaN, 4 - isObject, 5 - objDisplay, 6 - objectAttr, 7 - toArray, 8 - } from '@vitest/utils' 9 - import { parseSingleStack } from '@vitest/utils/source-map' 1 + import type { FixtureItem } from './fixture' 2 + import type { VitestRunner } from './types/runner' 10 3 import type { 11 4 Custom, 12 5 CustomAPI, ··· 26 19 TestFunction, 27 20 TestOptions, 28 21 } from './types/tasks' 29 - import type { VitestRunner } from './types/runner' 30 - import { createChainable } from './utils/chain' 31 22 import { 32 - collectTask, 23 + format, 24 + isNegativeNaN, 25 + isObject, 26 + objDisplay, 27 + objectAttr, 28 + toArray, 29 + } from '@vitest/utils' 30 + import { parseSingleStack } from '@vitest/utils/source-map' 31 + import { 33 32 collectorContext, 33 + collectTask, 34 34 createTestContext, 35 35 runWithSuite, 36 36 withTimeout, 37 37 } from './context' 38 - import { getHooks, setFixture, setFn, setHooks } from './map' 39 - import type { FixtureItem } from './fixture' 40 38 import { mergeContextFixtures, withFixtures } from './fixture' 39 + import { getHooks, setFixture, setFn, setHooks } from './map' 41 40 import { getCurrentTest } from './test-state' 41 + import { createChainable } from './utils/chain' 42 42 43 43 /** 44 44 * Creates a suite of tests, allowing for grouping and hierarchical organization of tests. ··· 499 499 } 500 500 501 501 function createSuite() { 502 - // eslint-disable-next-line unicorn/consistent-function-scoping 503 502 function suiteFn( 504 503 this: Record<string, boolean | undefined>, 505 504 name: string | Function,
+45 -45
packages/runner/src/types.ts
··· 1 1 export type { 2 - RunMode, 3 - TaskState, 4 - TaskBase, 5 - TaskPopulated, 6 - TaskMeta, 7 - TaskResult, 8 - TaskResultPack, 9 - Suite, 10 - File, 11 - Test, 12 - Custom, 13 - Task, 14 - DoneCallback, 15 - TestFunction, 16 - TestOptions, 17 - CustomAPI, 18 - TestAPI, 19 - FixtureOptions, 20 - Use, 21 - FixtureFn, 22 - Fixture, 23 - Fixtures, 24 - InferFixturesTypes, 25 - SuiteAPI, 26 - HookListener, 27 - HookCleanupCallback, 28 - SuiteHooks, 29 - TaskCustomOptions, 30 - SuiteCollector, 31 - SuiteFactory, 32 - RuntimeContext, 33 - TestContext, 34 - TaskContext, 35 - ExtendedContext, 36 - OnTestFailedHandler, 37 - OnTestFinishedHandler, 38 - SequenceHooks, 39 - SequenceSetupFiles, 2 + CancelReason, 3 + VitestRunner, 4 + VitestRunnerConfig, 5 + VitestRunnerConstructor, 6 + VitestRunnerImportSource, 7 + } from './types/runner' 8 + export type { 40 9 AfterAllListener, 41 10 AfterEachListener, 42 11 BeforeAllListener, 43 12 BeforeEachListener, 13 + Custom, 14 + CustomAPI, 15 + DoneCallback, 16 + ExtendedContext, 17 + File, 18 + Fixture, 19 + FixtureFn, 20 + FixtureOptions, 21 + Fixtures, 22 + HookCleanupCallback, 23 + HookListener, 24 + InferFixturesTypes, 25 + OnTestFailedHandler, 26 + OnTestFinishedHandler, 27 + RunMode, 28 + RuntimeContext, 29 + SequenceHooks, 30 + SequenceSetupFiles, 31 + Suite, 32 + SuiteAPI, 33 + SuiteCollector, 34 + SuiteFactory, 35 + SuiteHooks, 36 + Task, 37 + TaskBase, 38 + TaskContext, 39 + TaskCustomOptions, 44 40 TaskHook, 41 + TaskMeta, 42 + TaskPopulated, 43 + TaskResult, 44 + TaskResultPack, 45 + TaskState, 46 + Test, 47 + TestAPI, 48 + TestContext, 49 + TestFunction, 50 + TestOptions, 51 + Use, 45 52 } from './types/tasks' 46 - export type { 47 - VitestRunnerConfig, 48 - VitestRunnerImportSource, 49 - VitestRunnerConstructor, 50 - CancelReason, 51 - VitestRunner, 52 - } from './types/runner'
+3 -3
packages/snapshot/src/client.ts
··· 1 - import { deepMergeSnapshot } from './port/utils' 2 - import SnapshotState from './port/state' 3 - import type { SnapshotResult, SnapshotStateOptions } from './types' 4 1 import type { RawSnapshotInfo } from './port/rawSnapshot' 2 + import type { SnapshotResult, SnapshotStateOptions } from './types' 3 + import SnapshotState from './port/state' 4 + import { deepMergeSnapshot } from './port/utils' 5 5 6 6 function createMismatchError( 7 7 message: string,
+5 -5
packages/snapshot/src/index.ts
··· 1 1 export { SnapshotClient } from './client' 2 2 3 - export { default as SnapshotState } from './port/state' 4 - export { addSerializer, getSerializers } from './port/plugins' 5 3 export { stripSnapshotIndentation } from './port/inlineSnapshot' 4 + export { addSerializer, getSerializers } from './port/plugins' 5 + export { default as SnapshotState } from './port/state' 6 6 7 7 export type { 8 8 SnapshotData, 9 - SnapshotUpdateState, 10 - SnapshotStateOptions, 11 9 SnapshotMatchOptions, 12 10 SnapshotResult, 13 11 SnapshotSerializer, 14 - UncheckedSnapshot, 12 + SnapshotStateOptions, 15 13 SnapshotSummary, 14 + SnapshotUpdateState, 15 + UncheckedSnapshot, 16 16 } from './types'
+1 -1
packages/snapshot/src/manager.ts
··· 1 - import { basename, dirname, isAbsolute, join, resolve } from 'pathe' 2 1 import type { 3 2 SnapshotResult, 4 3 SnapshotStateOptions, 5 4 SnapshotSummary, 6 5 } from './types' 6 + import { basename, dirname, isAbsolute, join, resolve } from 'pathe' 7 7 8 8 export class SnapshotManager { 9 9 summary: SnapshotSummary = undefined!
+2 -2
packages/ui/client/global-setup.ts
··· 1 1 /// <reference types="vite-plugin-pages/client" /> 2 2 3 + import FloatingVue, { VTooltip } from 'floating-vue' 4 + import routes from 'virtual:generated-pages' 3 5 import { 4 6 createRouter as _createRouter, 5 7 createWebHashHistory, 6 8 } from 'vue-router' 7 - import FloatingVue, { VTooltip } from 'floating-vue' 8 - import routes from 'virtual:generated-pages' 9 9 import 'd3-graph-controller/default.css' 10 10 import 'splitpanes/dist/splitpanes.css' 11 11 import '@unocss/reset/tailwind.css'
+2 -2
packages/ui/client/test.ts
··· 1 1 import { 2 - type RenderOptions, 3 2 render as _render, 4 3 cleanup, 4 + type RenderOptions, 5 5 } from '@testing-library/vue' 6 6 import { VTooltip } from 'floating-vue' 7 7 import { afterEach } from 'vitest' ··· 21 21 cleanup() 22 22 }) 23 23 24 - export { within, screen } from '@testing-library/vue' 24 + export { screen, within } from '@testing-library/vue'
+4 -4
packages/ui/node/index.ts
··· 1 + import type { Plugin } from 'vite' 2 + import type { Vitest } from 'vitest/node' 1 3 import { fileURLToPath } from 'node:url' 4 + import { toArray } from '@vitest/utils' 2 5 import { basename, resolve } from 'pathe' 3 6 import sirv from 'sirv' 4 - import type { Plugin } from 'vite' 5 - import { coverageConfigDefaults } from 'vitest/config' 6 - import type { Vitest } from 'vitest/node' 7 - import { toArray } from '@vitest/utils' 8 7 import c from 'tinyrainbow' 8 + import { coverageConfigDefaults } from 'vitest/config' 9 9 import { version } from '../package.json' 10 10 11 11 export default (ctx: Vitest): Plugin => {
+8 -8
packages/ui/node/reporter.ts
··· 1 - import { promises as fs } from 'node:fs' 2 - import { fileURLToPath } from 'node:url' 3 - import { promisify } from 'node:util' 4 - import { gzip, constants as zlibConstants } from 'node:zlib' 5 - import { basename, dirname, relative, resolve } from 'pathe' 6 - import { globSync } from 'tinyglobby' 7 - import c from 'tinyrainbow' 8 - import { stringify } from 'flatted' 9 1 import type { 10 2 File, 11 3 ModuleGraphData, ··· 14 6 Vitest, 15 7 } from 'vitest' 16 8 import type { HTMLOptions } from 'vitest/node' 9 + import { promises as fs } from 'node:fs' 10 + import { fileURLToPath } from 'node:url' 11 + import { promisify } from 'node:util' 12 + import { gzip, constants as zlibConstants } from 'node:zlib' 13 + import { stringify } from 'flatted' 14 + import { basename, dirname, relative, resolve } from 'pathe' 15 + import { globSync } from 'tinyglobby' 16 + import c from 'tinyrainbow' 17 17 import { getModuleGraph } from '../../vitest/src/utils/graph' 18 18 19 19 interface PotentialConfig {
+2 -2
packages/utils/src/display.ts
··· 1 - // since this is already part of Vitest via Chai, we can just reuse it without increasing the size of bundle 2 - import * as loupe from 'loupe' 3 1 import type { PrettyFormatOptions } from '@vitest/pretty-format' 4 2 import { 5 3 format as prettyFormat, 6 4 plugins as prettyFormatPlugins, 7 5 } from '@vitest/pretty-format' 6 + // since this is already part of Vitest via Chai, we can just reuse it without increasing the size of bundle 7 + import * as loupe from 'loupe' 8 8 9 9 type Inspect = (value: unknown, options: Options) => string 10 10 interface Options {
+1 -1
packages/utils/src/error.ts
··· 1 + import type { TestError } from './types' 1 2 import { type DiffOptions, printDiffOrStringify } from './diff' 2 3 import { format, stringify } from './display' 3 - import type { TestError } from './types' 4 4 5 5 // utils is bundled for any environment and might not support `Element` 6 6 declare class Element {
+1 -1
packages/utils/src/highlight.ts
··· 1 - import { type TokenColors, highlight as baseHighlight } from 'tinyhighlight' 1 + import { highlight as baseHighlight, type TokenColors } from 'tinyhighlight' 2 2 import c, { type Colors } from 'tinyrainbow' 3 3 4 4 function getDefs(c: Colors): TokenColors {
+40 -40
packages/utils/src/index.ts
··· 1 1 export { 2 - notNullish, 3 - assertTypes, 4 - isPrimitive, 5 - slash, 6 - parseRegexp, 7 - isObject, 8 - getType, 9 - getOwnProperties, 10 - deepClone, 11 - clone, 12 - noop, 13 - objectAttr, 14 - createDefer, 15 - getCallLastIndex, 16 - isNegativeNaN, 17 - createSimpleStackTrace, 18 - toArray, 19 - deepMerge, 20 - } from './helpers' 21 - export type { DeferPromise } from './helpers' 22 - 23 - export { getSafeTimers, setSafeTimers } from './timers' 24 - export type { SafeTimers } from './timers' 25 - 26 - export { shuffle } from './random' 27 - export { 28 - stringify, 29 2 format, 30 3 inspect, 31 4 objDisplay, 5 + stringify, 32 6 } from './display' 33 7 export type { StringifyOptions } from './display' 8 + 34 9 export { 35 - positionToOffset, 36 - offsetToLineNumber, 37 - lineSplitRE, 38 - } from './offset' 10 + assertTypes, 11 + clone, 12 + createDefer, 13 + createSimpleStackTrace, 14 + deepClone, 15 + deepMerge, 16 + getCallLastIndex, 17 + getOwnProperties, 18 + getType, 19 + isNegativeNaN, 20 + isObject, 21 + isPrimitive, 22 + noop, 23 + notNullish, 24 + objectAttr, 25 + parseRegexp, 26 + slash, 27 + toArray, 28 + } from './helpers' 29 + export type { DeferPromise } from './helpers' 30 + 39 31 export { highlight } from './highlight' 32 + export { nanoid } from './nanoid' 33 + export { 34 + lineSplitRE, 35 + offsetToLineNumber, 36 + positionToOffset, 37 + } from './offset' 38 + export { shuffle } from './random' 39 + export { getSafeTimers, setSafeTimers } from './timers' 40 + 41 + export type { SafeTimers } from './timers' 40 42 41 43 export type { 42 - Awaitable, 43 - Nullable, 44 - Arrayable, 45 44 ArgumentsType, 46 - MergeInsertions, 47 - DeepMerge, 48 - MutableArray, 45 + Arrayable, 46 + Awaitable, 49 47 Constructable, 50 - ParsedStack, 48 + DeepMerge, 51 49 ErrorWithDiff, 50 + MergeInsertions, 51 + MutableArray, 52 + Nullable, 53 + ParsedStack, 52 54 SerializedError, 53 55 TestError, 54 56 } from './types' 55 - 56 - export { nanoid } from './nanoid'
+4 -4
packages/utils/src/source-map.ts
··· 1 - import { resolve } from 'pathe' 2 1 import type { SourceMapInput } from '@jridgewell/trace-mapping' 3 - import { TraceMap, originalPositionFor } from '@jridgewell/trace-mapping' 4 2 import type { ErrorWithDiff, ParsedStack } from './types' 3 + import { originalPositionFor, TraceMap } from '@jridgewell/trace-mapping' 4 + import { resolve } from 'pathe' 5 5 import { isPrimitive, notNullish } from './helpers' 6 6 7 7 export { 8 - TraceMap, 9 - originalPositionFor, 10 8 generatedPositionFor, 9 + originalPositionFor, 10 + TraceMap, 11 11 } from '@jridgewell/trace-mapping' 12 12 export type { SourceMapInput } from '@jridgewell/trace-mapping' 13 13
+4 -4
packages/vite-node/src/cli.ts
··· 1 + import type { ViteNodeServerOptions } from './types' 1 2 import { resolve } from 'node:path' 2 3 import cac from 'cac' 3 4 import c from 'tinyrainbow' 4 5 import { createServer, loadEnv } from 'vite' 5 6 import { version } from '../package.json' 6 - import { ViteNodeServer } from './server' 7 7 import { ViteNodeRunner } from './client' 8 - import type { ViteNodeServerOptions } from './types' 9 - import { toArray } from './utils' 10 8 import { createHotContext, handleMessage, viteNodeHmrPlugin } from './hmr' 9 + import { ViteNodeServer } from './server' 11 10 import { installSourcemapsSupport } from './source-map' 11 + import { toArray } from './utils' 12 12 13 13 const cli = cac('vite-node') 14 14 ··· 164 164 } 165 165 166 166 await waitForWatched(files) 167 - // eslint-disable-next-line no-console 167 + 168 168 console.log('[debug] watcher is ready') 169 169 } 170 170 }
+4 -4
packages/vite-node/src/client.ts
··· 1 - import { createRequire } from 'node:module' 1 + import type { HotContext, ModuleCache, ViteNodeRunnerOptions } from './types' 2 2 3 + import { createRequire } from 'node:module' 3 4 // we need native dirname, because windows __dirname has \\ 4 5 import { dirname } from 'node:path' 5 6 import { fileURLToPath, pathToFileURL } from 'node:url' 6 7 import vm from 'node:vm' 7 - import { resolve } from 'pathe' 8 8 import createDebug from 'debug' 9 + import { resolve } from 'pathe' 10 + import { extractSourceMap } from './source-map' 9 11 import { 10 12 cleanUrl, 11 13 createImportMetaEnvProxy, ··· 17 19 slash, 18 20 toFilePath, 19 21 } from './utils' 20 - import type { HotContext, ModuleCache, ViteNodeRunnerOptions } from './types' 21 - import { extractSourceMap } from './source-map' 22 22 23 23 const { setTimeout, clearTimeout } = globalThis 24 24
+2 -2
packages/vite-node/src/debug.ts
··· 1 + import type { TransformResult } from 'vite' 2 + import type { DebuggerOptions } from './types' 1 3 /* eslint-disable no-console */ 2 4 import { existsSync, promises as fs } from 'node:fs' 3 5 import { join, resolve } from 'pathe' 4 - import type { TransformResult } from 'vite' 5 6 import c from 'tinyrainbow' 6 - import type { DebuggerOptions } from './types' 7 7 8 8 function hashCode(s: string) { 9 9 return s.split('').reduce((a, b) => {
+2 -2
packages/vite-node/src/externalize.ts
··· 1 + import type { DepsHandlingOptions } from './types' 1 2 import { existsSync, promises as fsp } from 'node:fs' 2 3 import { dirname, extname, join } from 'pathe' 3 - import type { DepsHandlingOptions } from './types' 4 - import { findNearestPackageData, isNodeBuiltin, slash } from './utils' 5 4 import { KNOWN_ASSET_RE } from './constants' 5 + import { findNearestPackageData, isNodeBuiltin, slash } from './utils' 6 6 7 7 const BUILTIN_EXTENSIONS = new Set(['.mjs', '.cjs', '.node', '.wasm']) 8 8
+8 -8
packages/vite-node/src/server.ts
··· 1 - import { performance } from 'node:perf_hooks' 2 - import { existsSync } from 'node:fs' 3 - import assert from 'node:assert' 4 - import { pathToFileURL } from 'node:url' 5 - import { join, normalize, relative, resolve } from 'pathe' 6 1 import type { TransformResult, ViteDevServer } from 'vite' 7 - import createDebug from 'debug' 8 2 import type { 9 3 DebuggerOptions, 10 4 EncodedSourceMap, ··· 12 6 ViteNodeResolveId, 13 7 ViteNodeServerOptions, 14 8 } from './types' 9 + import assert from 'node:assert' 10 + import { existsSync } from 'node:fs' 11 + import { performance } from 'node:perf_hooks' 12 + import { pathToFileURL } from 'node:url' 13 + import createDebug from 'debug' 14 + import { join, normalize, relative, resolve } from 'pathe' 15 + import { Debugger } from './debug' 15 16 import { shouldExternalize } from './externalize' 17 + import { withInlineSourcemap } from './source-map' 16 18 import { 17 19 normalizeModuleId, 18 20 toArray, 19 21 toFilePath, 20 22 withTrailingSlash, 21 23 } from './utils' 22 - import { Debugger } from './debug' 23 - import { withInlineSourcemap } from './source-map' 24 24 25 25 export * from './externalize' 26 26
+3 -3
packages/vite-node/src/source-map-handler.ts
··· 3 3 // we make a custom implementatin because we don't need some features from source-map-support, 4 4 // like polyfilled Buffer, browser support, etc. 5 5 6 - import path from 'node:path' 7 - import fs from 'node:fs' 8 6 import type { 9 7 OriginalMapping, 10 8 SourceMapInput, 11 9 } from '@jridgewell/trace-mapping' 12 - import { TraceMap, originalPositionFor } from '@jridgewell/trace-mapping' 10 + import fs from 'node:fs' 11 + import path from 'node:path' 12 + import { originalPositionFor, TraceMap } from '@jridgewell/trace-mapping' 13 13 14 14 // Only install once if called multiple times 15 15 let errorFormatterInstalled = false
+3 -3
packages/vite-node/src/source-map.ts
··· 1 1 import type { TransformResult } from 'vite' 2 - import { dirname, isAbsolute, relative, resolve } from 'pathe' 3 - import { withTrailingSlash } from './utils' 4 - import { install } from './source-map-handler' 5 2 import type { EncodedSourceMap } from './types' 3 + import { dirname, isAbsolute, relative, resolve } from 'pathe' 4 + import { install } from './source-map-handler' 5 + import { withTrailingSlash } from './utils' 6 6 7 7 interface InstallSourceMapSupportOptions { 8 8 getSourceMap: (source: string) => EncodedSourceMap | null | undefined
+2 -2
packages/vite-node/src/types.ts
··· 1 - import type { ViteHotContext } from 'vite/types/hot.js' 2 1 import type { EncodedSourceMap } from '@jridgewell/trace-mapping' 2 + import type { ViteHotContext } from 'vite/types/hot.js' 3 3 import type { ModuleCacheMap, ViteNodeRunner } from './client' 4 4 5 5 export type Nullable<T> = T | null | undefined ··· 33 33 } 34 34 35 35 export type { 36 - EncodedSourceMap, 37 36 DecodedSourceMap, 37 + EncodedSourceMap, 38 38 SourceMapInput, 39 39 } from '@jridgewell/trace-mapping' 40 40
+4 -4
packages/vite-node/src/utils.ts
··· 1 - import { fileURLToPath, pathToFileURL } from 'node:url' 2 - import { builtinModules } from 'node:module' 3 - import { existsSync, promises as fsp } from 'node:fs' 4 - import { dirname, join, resolve } from 'pathe' 5 1 import type { Arrayable, Nullable } from './types' 2 + import { existsSync, promises as fsp } from 'node:fs' 3 + import { builtinModules } from 'node:module' 4 + import { fileURLToPath, pathToFileURL } from 'node:url' 5 + import { dirname, join, resolve } from 'pathe' 6 6 7 7 export const isWindows = process.platform === 'win32' 8 8
+1 -1
packages/vitest/src/defaults.ts
··· 1 - import os from 'node:os' 2 1 import type { 3 2 BenchmarkUserOptions, 4 3 CoverageV8Options, 5 4 ResolvedCoverageOptions, 6 5 UserConfig, 7 6 } from './node/types/config' 7 + import os from 'node:os' 8 8 import { isCI } from './utils/env' 9 9 10 10 export { defaultBrowserPort } from './constants'
+2 -2
packages/web-worker/src/pure.ts
··· 1 - import { createWorkerConstructor } from './worker' 2 1 import type { DefineWorkerOptions } from './types' 3 - import { assertGlobalExists } from './utils' 4 2 import { createSharedWorkerConstructor } from './shared-worker' 3 + import { assertGlobalExists } from './utils' 4 + import { createWorkerConstructor } from './worker' 5 5 6 6 export function defineWebWorkers(options?: DefineWorkerOptions) { 7 7 if (
+1 -1
packages/web-worker/src/shared-worker.ts
··· 1 + import type { Procedure } from './types' 1 2 import { 2 3 MessageChannel, 3 4 type MessagePort as NodeMessagePort, 4 5 } from 'node:worker_threads' 5 - import type { Procedure } from './types' 6 6 import { InlineWorkerRunner } from './runner' 7 7 import { debug, getFileIdFromUrl, getRunnerOptions } from './utils' 8 8
+2 -2
packages/web-worker/src/utils.ts
··· 1 - import { readFileSync as _readFileSync } from 'node:fs' 2 1 import type { WorkerGlobalState } from 'vitest' 2 + import type { CloneOption } from './types' 3 + import { readFileSync as _readFileSync } from 'node:fs' 3 4 import ponyfillStructuredClone from '@ungap/structured-clone' 4 5 import createDebug from 'debug' 5 - import type { CloneOption } from './types' 6 6 7 7 // keep the reference in case it was mocked 8 8 const readFileSync = _readFileSync
+1 -1
packages/ws-client/src/index.ts
··· 6 6 import type { WebSocketEvents, WebSocketHandlers } from 'vitest' 7 7 import { StateManager } from './state' 8 8 9 - export * from '@vitest/runner/utils' 10 9 export * from '../../vitest/src/utils/tasks' 10 + export * from '@vitest/runner/utils' 11 11 12 12 export interface VitestClientOptions { 13 13 handlers?: Partial<WebSocketEvents>
+3 -3
test/benchmark/test/basic.test.ts
··· 1 - import fs from 'node:fs' 2 - import { expect, it } from 'vitest' 3 - import * as pathe from 'pathe' 4 1 import type { FormattedBenchmarkReport } from 'vitest/src/node/reporters/benchmark/table/index.js' 2 + import fs from 'node:fs' 3 + import * as pathe from 'pathe' 4 + import { expect, it } from 'vitest' 5 5 import { runVitest } from '../../test-utils' 6 6 7 7 it('basic', { timeout: 60_000 }, async () => {
+1 -1
test/benchmark/test/reporter.test.ts
··· 1 - import { assert, expect, it } from 'vitest' 2 1 import * as pathe from 'pathe' 2 + import { assert, expect, it } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 it('summary', async () => {
+1 -1
test/benchmark/test/sequential.test.ts
··· 1 1 import fs from 'node:fs' 2 - import { expect, it } from 'vitest' 3 2 import * as pathe from 'pathe' 3 + import { expect, it } from 'vitest' 4 4 import { runVitest } from '../../test-utils' 5 5 6 6 it('sequential', async () => {
+1 -1
test/browser/test/cjs-lib.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import cjsDefault, { a as cjsNamed } from '@vitest/cjs-lib' 3 2 import * as cjsNamespace from '@vitest/cjs-lib' 3 + import { expect, test } from 'vitest' 4 4 5 5 test('cjs namespace import', () => { 6 6 expect(cjsNamespace).toEqual({
+2 -2
test/browser/test/dom.test.ts
··· 1 - import { beforeEach, describe, expect, test } from 'vitest' 2 - import { page } from '@vitest/browser/context' 3 1 import { createNode } from '#src/createNode' 2 + import { page } from '@vitest/browser/context' 3 + import { beforeEach, describe, expect, test } from 'vitest' 4 4 import '../src/button.css' 5 5 6 6 describe('dom related activity', () => {
+1 -1
test/browser/test/userEvent.test.ts
··· 1 - import { beforeEach, describe, expect, test, vi } from 'vitest' 2 1 import { userEvent as _uE, server } from '@vitest/browser/context' 2 + import { beforeEach, describe, expect, test, vi } from 'vitest' 3 3 import '../src/button.css' 4 4 5 5 beforeEach(() => {
+3 -3
test/browser/test/utils.test.ts
··· 1 - import { inspect } from 'vitest/utils' 2 - import { afterEach, expect, it, test } from 'vitest' 3 1 import { commands } from '@vitest/browser/context' 4 - 5 2 import { prettyDOM } from '@vitest/browser/utils' 3 + import { afterEach, expect, it, test } from 'vitest' 4 + 5 + import { inspect } from 'vitest/utils' 6 6 7 7 afterEach(() => { 8 8 document.body.innerHTML = ''
+1 -1
test/cli/test/console.test.ts
··· 1 + import { resolve } from 'pathe' 1 2 import { expect, test } from 'vitest' 2 3 import { DefaultReporter } from 'vitest/reporters' 3 - import { resolve } from 'pathe' 4 4 import { runVitest } from '../../test-utils' 5 5 6 6 test('can run custom pools with Vitest', async () => {
+1 -1
test/cli/test/expect-soft.test.ts
··· 1 - import { resolve } from 'node:path' 2 1 import type { UserConfig } from 'vitest' 2 + import { resolve } from 'node:path' 3 3 import { describe, expect, test } from 'vitest' 4 4 import { getCurrentTest } from 'vitest/suite' 5 5 import { runVitest } from '../../test-utils'
+2 -1
test/cli/test/fails.test.ts
··· 19 19 .reverse() 20 20 .filter(i => i.includes('Error: ') && !i.includes('Command failed') && !i.includes('stackStr') && !i.includes('at runTest') && !i.includes('at runWithTimeout')) 21 21 .map(i => i.trim().replace(root, '<rootDir>'), 22 - ).join('\n') 22 + ) 23 + .join('\n') 23 24 expect(msg).toMatchSnapshot(file) 24 25 }, 30_000) 25 26
+1 -1
test/cli/test/public-api.test.ts
··· 1 - import { expect, it } from 'vitest' 2 1 import type { File, TaskResultPack, UserConfig } from 'vitest' 3 2 import { resolve } from 'pathe' 3 + import { expect, it } from 'vitest' 4 4 import { runVitest } from '../../test-utils' 5 5 6 6 it.each([
+4 -4
test/cli/test/reported-tasks.test.ts
··· 1 - import { beforeAll, expect, it } from 'vitest' 2 - import { resolve } from 'pathe' 3 1 import type { RunnerTestFile } from 'vitest' 4 - import type { StateManager } from 'vitest/src/node/state.js' 5 2 import type { WorkspaceProject } from 'vitest/node' 6 - import { runVitest } from '../../test-utils' 3 + import type { StateManager } from 'vitest/src/node/state.js' 7 4 import type { TestCase, TestCollection, TestModule } from '../../../packages/vitest/src/node/reporters/reported-tasks' 5 + import { resolve } from 'pathe' 6 + import { beforeAll, expect, it } from 'vitest' 7 + import { runVitest } from '../../test-utils' 8 8 9 9 const now = new Date() 10 10 // const finishedFiles: File[] = []
+2 -2
test/config/test/bail.test.ts
··· 1 - import { expect, test } from 'vitest' 2 - 3 1 import type { UserConfig } from 'vitest/node' 2 + 3 + import { expect, test } from 'vitest' 4 4 import { runVitest } from '../../test-utils' 5 5 6 6 const configs: UserConfig[] = []
+1 -1
test/config/test/cache.test.ts
··· 1 - import { describe, expect, test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { describe, expect, test } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 const root = resolve(__dirname, '../fixtures/cache')
+1 -1
test/config/test/console-color.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { x } from 'tinyexec' 2 + import { expect, test } from 'vitest' 3 3 4 4 // use "x" directly since "runVitestCli" strips color 5 5
+1 -1
test/config/test/exec-args.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { x } from 'tinyexec' 2 + import { expect, test } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 const [nodeMajor, nodeMinor] = process.version.slice(1).split('.').map(Number)
+3 -3
test/config/test/failures.test.ts
··· 1 - import { beforeEach, expect, test } from 'vitest' 2 1 import type { UserConfig } from 'vitest/node' 3 - import { version } from 'vitest/package.json' 4 - 5 2 import { normalize, resolve } from 'pathe' 3 + import { beforeEach, expect, test } from 'vitest' 4 + 5 + import { version } from 'vitest/package.json' 6 6 import * as testUtils from '../../test-utils' 7 7 8 8 const providers = ['playwright', 'webdriverio', 'preview'] as const
+1 -1
test/config/test/mixed-environments.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import type { UserConfig } from 'vitest/node' 2 + import { expect, test } from 'vitest' 3 3 4 4 import { runVitest } from '../../test-utils' 5 5
+2 -2
test/config/test/override.test.ts
··· 1 - import type { UserConfig } from 'vitest/node' 2 1 import type { UserConfig as ViteUserConfig } from 'vite' 2 + import type { UserConfig } from 'vitest/node' 3 3 import { describe, expect, it } from 'vitest' 4 - import { createVitest, parseCLI } from 'vitest/node' 5 4 import { extraInlineDeps } from 'vitest/config' 5 + import { createVitest, parseCLI } from 'vitest/node' 6 6 7 7 type VitestOptions = Parameters<typeof createVitest>[3] 8 8
+2 -2
test/config/test/shard.test.ts
··· 1 - import { expect, test } from 'vitest' 1 + import type { UserConfig } from 'vitest/node' 2 2 import { basename } from 'pathe' 3 3 4 - import type { UserConfig } from 'vitest/node' 4 + import { expect, test } from 'vitest' 5 5 import * as testUtils from '../../test-utils' 6 6 7 7 function runVitest(config: UserConfig) {
+1 -1
test/config/test/workers-option.test.ts
··· 1 - import { describe, expect, test, vi } from 'vitest' 2 1 import type { UserConfig } from 'vitest/node' 2 + import { describe, expect, test, vi } from 'vitest' 3 3 4 4 import { getWorkersCountByPercentage } from 'vitest/src/utils/workers.js' 5 5 import * as testUtils from '../../test-utils'
+1 -1
test/config/test/workspace.test.ts
··· 1 - import { expect, it } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { expect, it } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 it('correctly runs workspace tests when workspace config path is specified', async () => {
+1 -1
test/core/__mocks__/zustand.ts
··· 1 - import actualCreate from 'zustand' 2 1 import { vi } from 'vitest' 2 + import actualCreate from 'zustand' 3 3 4 4 // when creating a store, we get its initial state, create a reset function and add it in the set 5 5 const create = vi.fn((createState) => {
+1 -1
test/core/test/browserAutomocker.test.ts
··· 1 + import { automockModule } from '@vitest/mocker/node' 1 2 import { parseAst } from 'vite' 2 3 import { expect, it } from 'vitest' 3 - import { automockModule } from '@vitest/mocker/node' 4 4 5 5 function automock(code: string) { 6 6 return automockModule(code, 'automock', parseAst).toString()
+1 -1
test/core/test/chainable.test.ts
··· 1 - import { describe, expect, it } from 'vitest' 2 1 import { createChainable } from '@vitest/runner/utils' 2 + import { describe, expect, it } from 'vitest' 3 3 4 4 describe('chainable', () => { 5 5 it('creates', () => {
+2 -2
test/core/test/cli-test.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { resolveConfig as viteResolveConfig } from 'vite' 3 - import { resolveConfig } from '../../../packages/vitest/src/node/config/resolveConfig.js' 2 + import { expect, test } from 'vitest' 4 3 import { createCLI, parseCLI } from '../../../packages/vitest/src/node/cli/cac.js' 4 + import { resolveConfig } from '../../../packages/vitest/src/node/config/resolveConfig.js' 5 5 6 6 const vitestCli = createCLI() 7 7
+1 -1
test/core/test/custom.test.ts
··· 1 - import { createChainable, getCurrentSuite } from 'vitest/suite' 2 1 import { 3 2 afterAll, 4 3 afterEach, ··· 8 7 expect, 9 8 test, 10 9 } from 'vitest' 10 + import { createChainable, getCurrentSuite } from 'vitest/suite' 11 11 import { Gardener } from '../src/custom/gardener.js' 12 12 13 13 // this function will be called, when Vitest collects tasks
+3 -3
test/core/test/diff.test.ts
··· 1 - import { stripVTControlCharacters } from 'node:util' 2 - import { expect, test, vi } from 'vitest' 3 1 import type { DiffOptions } from '@vitest/utils/diff' 4 - import { diff, diffStringsUnified, printDiffOrStringify } from '@vitest/utils/diff' 2 + import { stripVTControlCharacters } from 'node:util' 5 3 import { processError } from '@vitest/runner' 4 + import { diff, diffStringsUnified, printDiffOrStringify } from '@vitest/utils/diff' 5 + import { expect, test, vi } from 'vitest' 6 6 import { displayDiff } from '../../../packages/vitest/src/node/error' 7 7 8 8 test('displays string diff', () => {
+1 -1
test/core/test/expect.test.ts
··· 1 - import nodeAssert from 'node:assert' 2 1 import type { Tester } from '@vitest/expect' 2 + import nodeAssert from 'node:assert' 3 3 import { getCurrentTest } from '@vitest/runner' 4 4 import { assert, describe, expect, expectTypeOf, test, vi } from 'vitest' 5 5
+1 -1
test/core/test/immutable.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import im from 'immutable' 2 + import { expect, test } from 'vitest' 3 3 4 4 test('basic', () => { 5 5 expect(im.List([{ x: 1 }])).toEqual(im.List([{ x: 1 }]))
+1 -1
test/core/test/injector-mock.test.ts
··· 1 + import type { HoistMocksPluginOptions } from '../../../packages/mocker/src/node/hoistMocksPlugin' 1 2 import { stripVTControlCharacters } from 'node:util' 2 3 import { parseAst } from 'rollup/parseAst' 3 4 import { describe, expect, it, test } from 'vitest' 4 5 import { generateCodeFrame } from 'vitest/src/node/error.js' 5 - import type { HoistMocksPluginOptions } from '../../../packages/mocker/src/node/hoistMocksPlugin' 6 6 import { hoistMocks } from '../../../packages/mocker/src/node/hoistMocksPlugin' 7 7 8 8 function parse(code: string, options: any) {
+1 -1
test/core/test/jest-expect.test.ts
··· 1 1 /* eslint-disable no-sparse-arrays */ 2 2 import { AssertionError } from 'node:assert' 3 3 import { stripVTControlCharacters } from 'node:util' 4 - import { describe, expect, it, vi } from 'vitest' 5 4 import { generateToBeMessage } from '@vitest/expect' 6 5 import { processError } from '@vitest/utils/error' 6 + import { describe, expect, it, vi } from 'vitest' 7 7 8 8 class TestError extends Error {} 9 9
+1 -1
test/core/test/mock-fs.test.ts
··· 1 + import { fs, vol } from 'memfs' 1 2 // hello-world.test.js 2 3 import { beforeEach, expect, it, vi } from 'vitest' 3 - import { fs, vol } from 'memfs' 4 4 import { readHelloWorld } from '../src/read-hello-world' 5 5 6 6 // tell vitest to use fs mock from __mocks__ folder
+2 -2
test/core/test/mock-internals.test.ts
··· 1 1 import childProcess, { exec } from 'node:child_process' 2 2 import timers from 'node:timers' 3 - import { type MockInstance, afterEach, beforeEach, describe, expect, test, vi } from 'vitest' 4 - import { execDefault, execHelloWorld, execImportAll } from '../src/exec' 3 + import { afterEach, beforeEach, describe, expect, type MockInstance, test, vi } from 'vitest' 5 4 import { dynamicImport } from '../src/dynamic-import' 5 + import { execDefault, execHelloWorld, execImportAll } from '../src/exec' 6 6 7 7 vi.mock('child_process') 8 8 vi.mock('timers') // node built in inside __mocks__
+1 -1
test/core/test/mocked-circular.test.ts
··· 1 1 import { expect, it, vi } from 'vitest' 2 2 3 + import { circularA } from '../src/circularA' 3 4 // The order of the two imports here matters: B before A 4 5 import { circularB } from '../src/circularB' 5 - import { circularA } from '../src/circularA' 6 6 7 7 vi.mock('../src/circularB') 8 8
+1 -1
test/core/test/mocked-import-circular.test.ts
··· 1 1 import { expect, it, vi } from 'vitest' 2 2 3 + import { circularA } from '../src/circularA' 3 4 // The order of the two imports here matters: B before A 4 5 import { circularB } from '../src/circularB' 5 - import { circularA } from '../src/circularA' 6 6 7 7 vi.mock(import('../src/circularB')) 8 8
+3 -3
test/core/test/mocked.test.ts
··· 2 2 import { assert, describe, expect, test, vi, vitest } from 'vitest' 3 3 // @ts-expect-error not typed module 4 4 import { value as virtualValue } from 'virtual-module' 5 - import { two } from '../src/submodule' 5 + import * as globalMock from '../src/global-mock' 6 6 import * as mocked from '../src/mockedA' 7 7 import { mockedB } from '../src/mockedB' 8 - import { MockedC, asyncFunc, exportedStream } from '../src/mockedC' 8 + import { asyncFunc, exportedStream, MockedC } from '../src/mockedC' 9 9 import MockedDefault, { MockedC as MockedD } from '../src/mockedD' 10 - import * as globalMock from '../src/global-mock' 10 + import { two } from '../src/submodule' 11 11 12 12 vitest.mock('../src/submodule') 13 13 vitest.mock('virtual-module', () => ({ value: 'mock' }))
+2 -2
test/core/test/module.test.ts
··· 21 21 // @ts-expect-error is not typed with imports 22 22 import * as classCjs from '../src/cjs/class-cjs' 23 23 24 + import format from '../src/cjs/default-function' 25 + 24 26 // @ts-expect-error is not typed with imports 25 27 import * as nestedDefaultCjs from '../src/cjs/nested-default-cjs' 26 - 27 - import format from '../src/cjs/default-function' 28 28 29 29 // @ts-expect-error is not typed with imports 30 30 import * as nestedDefaultExternalCjs from '../src/external/nested-default-cjs'
+1 -1
test/core/test/node-protocol-jsdom.spec.ts
··· 1 1 // @vitest-environment jsdom 2 2 3 + import nodeUrl from 'node:url' 3 4 // outdated url package, which Vite will resolve to, if "url" import is used 4 5 // this should help catch bugs in source code 5 6 // eslint-disable-next-line unicorn/prefer-node-protocol 6 7 import packageUrl from 'url' 7 - import nodeUrl from 'node:url' 8 8 import { expect, it } from 'vitest' 9 9 10 10 it('vitest resolves url to installed url package, but node:url to internal Node module', () => {
+1 -1
test/core/test/node-protocol-node.spec.ts
··· 1 1 // @vitest-environment node 2 2 3 + import nodeUrl from 'node:url' 3 4 // eslint-disable-next-line unicorn/prefer-node-protocol 4 5 import packageUrl from 'url' 5 - import nodeUrl from 'node:url' 6 6 import { expect, it } from 'vitest' 7 7 8 8 it('vitest resolves both "url" and "node:url" to internal URL module in Node environment', () => {
+1 -1
test/core/test/resolve-ssr.test.ts
··· 1 1 // @vitest-environment node 2 2 3 3 import { expect, test } from 'vitest' 4 - import pkgNode from '../src/external/pkg-node' 5 4 import pkgBrowser from '../src/external/pkg-browser' 5 + import pkgNode from '../src/external/pkg-node' 6 6 7 7 test('[ssr] resolves to ssr, when node is first in conditions', () => { 8 8 expect(pkgNode).toBe('ssr')
+1 -1
test/core/test/resolve-web.test.ts
··· 1 1 // @vitest-environment happy-dom 2 2 3 3 import { expect, test } from 'vitest' 4 - import pkgNode from '../src/external/pkg-node' 5 4 import pkgBrowser from '../src/external/pkg-browser' 5 + import pkgNode from '../src/external/pkg-node' 6 6 7 7 test('[web] resolves to ssr, when node is first in conditions', () => { 8 8 expect(pkgNode).toBe('ssr')
+4 -4
test/core/test/sequencers.test.ts
··· 1 1 import type { Vitest, WorkspaceProject } from 'vitest/node' 2 - import { describe, expect, test, vi } from 'vitest' 3 - import { RandomSequencer } from '../../../packages/vitest/src/node/sequencers/RandomSequencer' 4 - import { BaseSequencer } from '../../../packages/vitest/src/node/sequencers/BaseSequencer' 5 - import { TestSpecification } from '../../../packages/vitest/src/node/spec' 6 2 import type { WorkspaceSpec as DeprecatedWorkspaceSpec } from '../../../packages/vitest/src/node/pool' 3 + import { describe, expect, test, vi } from 'vitest' 4 + import { BaseSequencer } from '../../../packages/vitest/src/node/sequencers/BaseSequencer' 5 + import { RandomSequencer } from '../../../packages/vitest/src/node/sequencers/RandomSequencer' 6 + import { TestSpecification } from '../../../packages/vitest/src/node/spec' 7 7 8 8 function buildCtx() { 9 9 return {
+1 -1
test/core/test/utils-display.spec.ts
··· 1 1 import util from 'node:util' 2 - import { describe, expect, test } from 'vitest' 3 2 import { format } from '@vitest/utils' 3 + import { describe, expect, test } from 'vitest' 4 4 5 5 describe('format', () => { 6 6 const obj = {} as any
+4 -4
test/core/test/utils.spec.ts
··· 1 - import { beforeAll, describe, expect, test } from 'vitest' 2 - import { assertTypes, deepClone, deepMerge, isNegativeNaN, objDisplay, objectAttr, toArray } from '@vitest/utils' 3 - import { resetModules } from '../../../packages/vitest/src/runtime/utils' 4 - import { deepMergeSnapshot } from '../../../packages/snapshot/src/port/utils' 5 1 import type { EncodedSourceMap } from '../../../packages/vite-node/src/types' 2 + import { assertTypes, deepClone, deepMerge, isNegativeNaN, objDisplay, objectAttr, toArray } from '@vitest/utils' 3 + import { beforeAll, describe, expect, test } from 'vitest' 4 + import { deepMergeSnapshot } from '../../../packages/snapshot/src/port/utils' 6 5 import { ModuleCacheMap } from '../../../packages/vite-node/src/client' 6 + import { resetModules } from '../../../packages/vitest/src/runtime/utils' 7 7 8 8 describe('assertTypes', () => { 9 9 test('the type of value should be number', () => {
+1 -1
test/core/test/vi.spec.ts
··· 2 2 * @vitest-environment jsdom 3 3 */ 4 4 5 - import type { Mock, MockInstance, MockedFunction, MockedObject } from 'vitest' 5 + import type { Mock, MockedFunction, MockedObject, MockInstance } from 'vitest' 6 6 import { describe, expect, expectTypeOf, test, vi } from 'vitest' 7 7 import { getWorkerState } from '../../../packages/vitest/src/runtime/utils' 8 8
+2 -2
test/core/test/web-worker-jsdom.test.ts
··· 1 1 // @vitest-environment jsdom 2 2 3 - import '@vitest/web-worker' 4 - 5 3 import { expect, it } from 'vitest' 4 + 6 5 import GlobalsWorker from '../src/web-worker/worker-globals?worker' 6 + import '@vitest/web-worker' 7 7 8 8 it('worker with invalid url throws an error', async () => { 9 9 const url = import.meta.url
+1 -1
test/core/test/web-worker-mock.test.ts
··· 1 - import '@vitest/web-worker' 2 1 import { expect, test, vi } from 'vitest' 3 2 import { workerDep } from '../src/web-worker/mock/worker-dep' 3 + import '@vitest/web-worker' 4 4 5 5 vi.mock(import('../src/web-worker/mock/worker-dep'), () => ({ workerDep: () => 'mocked' })) 6 6
+5 -5
test/core/test/web-worker-node.test.ts
··· 1 1 // @vitest-environment node 2 2 3 - import '@vitest/web-worker' 4 - 5 3 import { version } from 'node:process' 6 - import { beforeEach, describe, expect, it, vi } from 'vitest' 7 4 8 - import MyWorker from '../src/web-worker/worker?worker' 9 - import MyObjectWorker from '../src/web-worker/objectWorker?worker' 5 + import { beforeEach, describe, expect, it, vi } from 'vitest' 10 6 import MyEventListenerWorker from '../src/web-worker/eventListenerWorker?worker' 7 + 8 + import MyObjectWorker from '../src/web-worker/objectWorker?worker' 11 9 import MySelfWorker from '../src/web-worker/selfWorker?worker' 12 10 import MySharedWorker from '../src/web-worker/sharedWorker?sharedworker' 11 + import MyWorker from '../src/web-worker/worker?worker' 13 12 import GlobalsWorker from '../src/web-worker/worker-globals?worker' 13 + import '@vitest/web-worker' 14 14 15 15 const major = Number(version.split('.')[0].slice(1)) 16 16
+1 -1
test/core/vitest-environment-custom/index.ts
··· 1 + import type { Environment } from 'vitest' 1 2 import vm from 'node:vm' 2 3 import debug from 'debug' 3 - import type { Environment } from 'vitest' 4 4 5 5 // test that external packages (debug) are loaded correctly 6 6 const log = debug('test:env')
+1 -1
test/coverage-test/test/bundled-sources.test.ts
··· 1 1 import libCoverage from 'istanbul-lib-coverage' 2 2 import { expect } from 'vitest' 3 - import { coverageTest, isV8Provider, normalizeURL, readCoverageJson, runVitest, test } from '../utils.js' 4 3 import * as transpiled from '../fixtures/src/pre-bundle/bundle.js' 4 + import { coverageTest, isV8Provider, normalizeURL, readCoverageJson, runVitest, test } from '../utils.js' 5 5 6 6 test('bundled code with source maps to originals', async () => { 7 7 await runVitest({
+1 -1
test/coverage-test/test/configuration-options.test-d.ts
··· 1 - import { assertType, test } from 'vitest' 2 1 import type { CoverageProviderModule, ResolvedCoverageOptions, Vitest } from 'vitest' 3 2 import type { defineConfig } from 'vitest/config' 3 + import { assertType, test } from 'vitest' 4 4 5 5 type NarrowToTestConfig<T> = T extends { test?: any } ? NonNullable<T['test']> : never 6 6 type Configuration = NarrowToTestConfig<(Parameters<typeof defineConfig>[0])>
+2 -2
test/coverage-test/test/custom-reporter.test.ts
··· 1 - import { readFileSync, readdirSync } from 'node:fs' 1 + import { readdirSync, readFileSync } from 'node:fs' 2 2 import { resolve } from 'node:path' 3 3 import { expect } from 'vitest' 4 - import { coverageTest, normalizeURL, runVitest, test } from '../utils' 5 4 import { sum } from '../fixtures/src/math' 5 + import { coverageTest, normalizeURL, runVitest, test } from '../utils' 6 6 7 7 test('custom reporter', async () => { 8 8 await runVitest({
+1 -1
test/coverage-test/test/decorators.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 2 import { DecoratorsTester } from '../fixtures/src/decorators' 3 + import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 4 4 5 5 test('decorators generated metadata is ignored', async () => { 6 6 await runVitest({
+1 -1
test/coverage-test/test/dynamic-files.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 2 import { runDynamicFileCJS, runDynamicFileESM } from '../fixtures/src/dynamic-files' 3 + import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 4 4 5 5 test('does not crash when files are created and removed during test run (#3657)', async () => { 6 6 await runVitest({
+1 -1
test/coverage-test/test/empty-coverage-directory.test.ts
··· 1 1 import { existsSync } from 'node:fs' 2 2 import { beforeEach, expect } from 'vitest' 3 - import { captureStdout, coverageTest, normalizeURL, runVitest, test } from '../utils' 4 3 import { sum } from '../fixtures/src/math' 4 + import { captureStdout, coverageTest, normalizeURL, runVitest, test } from '../utils' 5 5 6 6 beforeEach(() => { 7 7 return captureStdout()
+1 -1
test/coverage-test/test/empty-lines.v8.test.ts
··· 1 1 import { beforeAll, expect } from 'vitest' 2 - import { coverageTest, describe, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 2 import { add } from '../fixtures/src/empty-lines' 3 + import { coverageTest, describe, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 4 4 5 5 type CoveredLine = 1 6 6 type UncoveredLine = 0
+1 -1
test/coverage-test/test/exclude-after-remap.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils.js' 3 2 import * as transpiled from '../fixtures/src/pre-bundle/bundle.js' 3 + import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils.js' 4 4 5 5 test('{ excludeAfterRemap: true } should exclude files that come up after remapping', async () => { 6 6 await runVitest({
+1 -1
test/coverage-test/test/implicit-else.istanbul.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 2 import { implicitElse } from '../fixtures/src/implicit-else' 3 + import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 4 4 5 5 test('implicit else is included in branch count', async () => { 6 6 await runVitest({
+1 -1
test/coverage-test/test/import-meta-env.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 2 import { useImportEnv } from '../fixtures/src/import-meta-env' 3 + import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 4 4 5 5 test('file using import.meta.env is included in report (#2332)', async () => { 6 6 await runVitest(
+3 -3
test/coverage-test/test/mixed-versions-warning.unit.test.ts
··· 1 1 import { stripVTControlCharacters } from 'node:util' 2 - import { expect, test, vi } from 'vitest' 3 - import { configDefaults } from 'vitest/config' 2 + import IstanbulProvider from '@vitest/coverage-istanbul' 4 3 import V8Provider from '@vitest/coverage-v8' 5 4 import packageJson from '@vitest/coverage-v8/package.json' 6 - import IstanbulProvider from '@vitest/coverage-istanbul' 5 + import { expect, test, vi } from 'vitest' 6 + import { configDefaults } from 'vitest/config' 7 7 8 8 const version = packageJson.version 9 9
+1 -1
test/coverage-test/test/on-failure.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { captureStdout, coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 3 2 import { sum } from '../fixtures/src/math' 3 + import { captureStdout, coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 4 4 5 5 test('report is not generated when tests fail', async () => { 6 6 const stdout = captureStdout()
+1 -1
test/coverage-test/test/test-reporter-conflicts.test.ts
··· 1 - import { resolve } from 'node:path' 2 1 import { readdirSync } from 'node:fs' 2 + import { resolve } from 'node:path' 3 3 import { expect } from 'vitest' 4 4 import { runVitest, test } from '../utils' 5 5
+1 -1
test/coverage-test/test/threshold-auto-update.unit.test.ts
··· 1 - import { parseModule } from 'magicast' 2 1 import type { CoverageMap } from 'istanbul-lib-coverage' 3 2 import { createCoverageSummary } from 'istanbul-lib-coverage' 3 + import { parseModule } from 'magicast' 4 4 5 5 import { expect, test } from 'vitest' 6 6 import { defineConfig } from 'vitest/config'
+1 -1
test/coverage-test/test/threshold-failure.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 3 2 import { sum } from '../fixtures/src/math' 3 + import { coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 4 4 5 5 test('failing thresholds', async () => { 6 6 const { exitCode, stderr } = await runVitest({
+2 -2
test/coverage-test/test/threshold-glob.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 3 - import { sum } from '../fixtures/src/math' 4 2 import { isEven, isOdd } from '../fixtures/src/even' 3 + import { sum } from '../fixtures/src/math' 4 + import { coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 5 5 6 6 test('threshold glob patterns count in global coverage', async () => { 7 7 await runVitest({
+1 -1
test/coverage-test/test/vue.test.ts
··· 1 - import { resolve } from 'node:path' 2 1 import { readdirSync } from 'node:fs' 2 + import { resolve } from 'node:path' 3 3 import { beforeAll, expect } from 'vitest' 4 4 import { isBrowser, isV8Provider, readCoverageMap, runVitest, test } from '../utils' 5 5
+1 -1
test/global-setup/globalSetup/another-vite-instance.ts
··· 1 - import { createServer } from 'vite' 2 1 import { resolve } from 'pathe' 2 + import { createServer } from 'vite' 3 3 4 4 let teardownHappened = false 5 5
+3 -3
test/public-mocker/test/mocker.test.ts
··· 1 - import { mockerPlugin } from '@vitest/mocker/node' 1 + import type { Browser } from 'playwright' 2 2 import type { UserConfig } from 'vite' 3 + import { mockerPlugin } from '@vitest/mocker/node' 4 + import { chromium } from 'playwright' 3 5 import { createServer } from 'vite' 4 6 import { beforeAll, expect, it, onTestFinished } from 'vitest' 5 - import type { Browser } from 'playwright' 6 - import { chromium } from 'playwright' 7 7 8 8 let browser: Browser 9 9 beforeAll(async () => {
+2 -2
test/reporters/src/context.ts
··· 1 1 import type { ModuleGraph, ViteDevServer } from 'vite' 2 - import type { Logger } from '../../../packages/vitest/src/node/logger' 3 2 import type { Vitest } from '../../../packages/vitest/src/node/core' 4 - import type { File } from '../../../packages/vitest/src/public/index' 3 + import type { Logger } from '../../../packages/vitest/src/node/logger' 5 4 import type { StateManager } from '../../../packages/vitest/src/node/state' 6 5 import type { ResolvedConfig } from '../../../packages/vitest/src/node/types/config' 6 + import type { File } from '../../../packages/vitest/src/public/index' 7 7 8 8 interface Context { 9 9 vitest: Vitest
+1 -1
test/reporters/tests/code-frame-line-limit.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { expect, test } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 test('show code frame', async () => {
+1 -1
test/reporters/tests/configuration-options.test-d.ts
··· 1 - import { assertType, test } from 'vitest' 2 1 import type { defineConfig } from 'vitest/config' 2 + import { assertType, test } from 'vitest' 3 3 4 4 type NarrowToTestConfig<T> = T extends { test?: any } ? NonNullable<T['test']> : never 5 5 type Configuration = NonNullable<NarrowToTestConfig<(Parameters<typeof defineConfig>[0])>>
+2 -2
test/reporters/tests/console.test.ts
··· 1 - import { resolve } from 'pathe' 2 - import { type UserConsoleLog, expect, test } from 'vitest' 3 1 import type { Reporter } from 'vitest/reporters' 2 + import { resolve } from 'pathe' 3 + import { expect, test, type UserConsoleLog } from 'vitest' 4 4 import { DefaultReporter } from 'vitest/reporters' 5 5 import { runVitest } from '../../test-utils' 6 6
+1 -1
test/reporters/tests/custom-diff-config.spec.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { expect, test } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 test('custom diff config', async () => {
+1 -1
test/reporters/tests/custom-reporter.spec.ts
··· 1 1 import { resolve } from 'pathe' 2 2 import { describe, expect, test } from 'vitest' 3 3 4 - import TestReporter from '../src/custom-reporter' 5 4 import { runVitest, runVitestCli } from '../../test-utils' 5 + import TestReporter from '../src/custom-reporter' 6 6 7 7 const customTsReporterPath = resolve(__dirname, '../src/custom-reporter.ts') 8 8 const customJSReporterPath = resolve(__dirname, '../src/custom-reporter.js')
+1 -1
test/reporters/tests/function-as-name.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { expect, test } from 'vitest' 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 test('should print function name', async () => {
+1 -1
test/reporters/tests/github-actions.test.ts
··· 1 1 import { resolve } from 'pathe' 2 2 import { expect, test } from 'vitest' 3 - import { runVitest } from '../../test-utils' 4 3 import { GithubActionsReporter } from '../../../packages/vitest/src/node/reporters' 4 + import { runVitest } from '../../test-utils' 5 5 6 6 test(GithubActionsReporter, async () => { 7 7 let { stdout, stderr } = await runVitest(
+2 -2
test/reporters/tests/html.test.ts
··· 1 1 import fs from 'node:fs' 2 - import zlib from 'node:zlib' 3 2 import { stripVTControlCharacters } from 'node:util' 3 + import zlib from 'node:zlib' 4 + import { parse } from 'flatted' 4 5 import { resolve } from 'pathe' 5 6 import { describe, expect, it } from 'vitest' 6 - import { parse } from 'flatted' 7 7 8 8 import { runVitest } from '../../test-utils' 9 9
+1 -1
test/reporters/tests/indicator-position.test.ts
··· 1 1 import { readFileSync } from 'node:fs' 2 - import { expect, test } from 'vitest' 3 2 import { resolve } from 'pathe' 3 + import { expect, test } from 'vitest' 4 4 import { runVitest } from '../../test-utils' 5 5 6 6 test('should print correct indicator position', async () => {
+2 -2
test/reporters/tests/junit.test.ts
··· 1 1 import type { File, Suite, Task, TaskResult } from 'vitest' 2 - import { expect, test } from 'vitest' 3 2 import { resolve } from 'pathe' 4 - import { runVitest } from '../../test-utils' 3 + import { expect, test } from 'vitest' 5 4 import { getDuration } from '../../../packages/vitest/src/node/reporters/junit' 5 + import { runVitest } from '../../test-utils' 6 6 7 7 const root = resolve(__dirname, '../fixtures') 8 8
+1 -1
test/reporters/tests/reporters.spec.ts
··· 1 1 import { existsSync, readFileSync, rmSync } from 'node:fs' 2 - import { beforeEach, expect, test, vi } from 'vitest' 3 2 import { normalize, resolve } from 'pathe' 3 + import { beforeEach, expect, test, vi } from 'vitest' 4 4 import { JsonReporter } from '../../../packages/vitest/src/node/reporters/json' 5 5 import { JUnitReporter } from '../../../packages/vitest/src/node/reporters/junit' 6 6 import { TapReporter } from '../../../packages/vitest/src/node/reporters/tap'
+3 -3
test/reporters/tests/utils.test.ts
··· 1 + import type { ViteNodeRunner } from 'vite-node/client' 2 + import type { Vitest } from 'vitest' 1 3 /** 2 4 * @format 3 5 */ 4 6 import { resolve } from 'pathe' 5 - import type { ViteNodeRunner } from 'vite-node/client' 6 - import type { Vitest } from 'vitest' 7 7 import { describe, expect, test } from 'vitest' 8 - import { createReporters } from '../../../packages/vitest/src/node/reporters/utils' 9 8 import { DefaultReporter } from '../../../packages/vitest/src/node/reporters/default' 9 + import { createReporters } from '../../../packages/vitest/src/node/reporters/utils' 10 10 import TestReporter from '../src/custom-reporter' 11 11 12 12 const customReporterPath = resolve(__dirname, '../src/custom-reporter.js')
+1 -1
test/snapshots/test/custom-environment.test.ts
··· 1 1 import { readFileSync, rmSync, writeFileSync } from 'node:fs' 2 - import { afterEach, expect, test } from 'vitest' 3 2 import { dirname, resolve } from 'pathe' 3 + import { afterEach, expect, test } from 'vitest' 4 4 import { runVitest } from '../../test-utils' 5 5 6 6 const testFileName = resolve(import.meta.dirname, './fixtures/custom-snapshot-environment/test/snapshots.test.ts')
+1 -1
test/snapshots/test/snapshots.test.ts
··· 1 1 import fs from 'node:fs/promises' 2 - import { expect, test } from 'vitest' 3 2 import pathe from 'pathe' 3 + import { expect, test } from 'vitest' 4 4 5 5 import { editFile, runVitest } from '../../test-utils' 6 6
+1 -1
test/ui/test/html-report.spec.ts
··· 1 + import type { PreviewServer } from 'vite' 1 2 import { Writable } from 'node:stream' 2 3 import { expect, test } from '@playwright/test' 3 - import type { PreviewServer } from 'vite' 4 4 import { preview } from 'vite' 5 5 import { startVitest } from 'vitest/node' 6 6
+1 -1
test/ui/test/ui.spec.ts
··· 1 1 import { Writable } from 'node:stream' 2 2 import { expect, test } from '@playwright/test' 3 - import { type Vitest, startVitest } from 'vitest/node' 3 + import { startVitest, type Vitest } from 'vitest/node' 4 4 5 5 const port = 9000 6 6 const pageUrl = `http://localhost:${port}/__vitest__/`
+1 -1
test/vite-node/test/circular.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { expect, test } from 'vitest' 3 3 import { runViteNodeCli } from '../../test-utils' 4 4 5 5 test('circular 1', async () => {
+1 -1
test/vite-node/test/hmr.test.ts
··· 1 - import { test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { test } from 'vitest' 3 3 import { editFile, runViteNodeCli } from '../../test-utils' 4 4 5 5 test('hmr.accept works correctly', async () => {
+2 -2
test/vite-node/test/self-export.test.ts
··· 1 - import { expect, it } from 'vitest' 2 1 import { resolve } from 'pathe' 3 - import ansiEscapes, { HelloWorld } from '../src/self-export' 2 + import { expect, it } from 'vitest' 4 3 import { runViteNodeCli } from '../../test-utils' 4 + import ansiEscapes, { HelloWorld } from '../src/self-export' 5 5 6 6 it('should export self', () => { 7 7 expect(ansiEscapes.HelloWorld).eq(HelloWorld)
+1 -1
test/vite-node/test/server.test.ts
··· 1 1 import { join, resolve } from 'pathe' 2 + import { createServer, type Plugin, type ViteDevServer } from 'vite' 2 3 import { ViteNodeServer } from 'vite-node/server' 3 4 import { describe, expect, test, vi } from 'vitest' 4 - import { type Plugin, type ViteDevServer, createServer } from 'vite' 5 5 import { extractSourceMap } from '../../../packages/vite-node/src/source-map' 6 6 7 7 describe('server works correctly', async () => {
+1 -1
test/vite-node/test/sourcemap.test.ts
··· 1 + import type { SourceMap } from 'rollup' 1 2 /* eslint-disable no-template-curly-in-string */ 2 3 import type { TransformResult } from 'vite' 3 4 import { describe, expect, it } from 'vitest' 4 - import type { SourceMap } from 'rollup' 5 5 import { withInlineSourcemap } from '../../../packages/vite-node/src/source-map' 6 6 7 7 it('regex match', () => {
+1 -1
test/watch/test/related.test.ts
··· 1 - import { test } from 'vitest' 2 1 import { resolve } from 'pathe' 2 + import { test } from 'vitest' 3 3 import { editFile, runVitest } from '../../test-utils' 4 4 5 5 test('when nothing is changed, run nothing but keep watching', async () => {
+2 -2
test/watch/test/workspaces.test.ts
··· 1 - import { fileURLToPath } from 'node:url' 2 1 import { readFileSync, rmSync, writeFileSync } from 'node:fs' 3 - import { afterAll, afterEach, expect, it } from 'vitest' 2 + import { fileURLToPath } from 'node:url' 4 3 import { dirname, resolve } from 'pathe' 4 + import { afterAll, afterEach, expect, it } from 'vitest' 5 5 6 6 import { runVitestCli } from '../../test-utils' 7 7
+1 -1
test/workspaces/coverage-report-tests/check-coverage.test.ts
··· 1 1 import { existsSync, readFileSync } from 'node:fs' 2 - import { expect, test } from 'vitest' 3 2 import libCoverage from 'istanbul-lib-coverage' 4 3 import { resolve } from 'pathe' 4 + import { expect, test } from 'vitest' 5 5 6 6 test('coverage exists', () => { 7 7 expect(existsSync('./coverage')).toBe(true)
+1 -1
test/workspaces/space-pools/isolate.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import type { UserConfig } from 'vitest/config' 2 + import { expect, test } from 'vitest' 3 3 4 4 test('is isolated', () => { 5 5 // @ts-expect-error -- internal
+1 -1
test/workspaces/space-pools/multi-worker.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import type { UserConfig } from 'vitest/config' 2 + import { expect, test } from 'vitest' 3 3 4 4 test('is multi worker', () => { 5 5 // @ts-expect-error -- internal
+1 -1
test/workspaces/space-pools/no-isolate.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import type { UserConfig } from 'vitest/config' 2 + import { expect, test } from 'vitest' 3 3 4 4 test('is not isolated', () => { 5 5 // @ts-expect-error -- internal
+1 -1
test/workspaces/space-pools/single-worker.test.ts
··· 1 - import { expect, test } from 'vitest' 2 1 import type { UserConfig } from 'vitest/config' 2 + import { expect, test } from 'vitest' 3 3 4 4 test('is single worker', () => { 5 5 // @ts-expect-error -- internal
+1 -1
packages/browser/src/client/channel.ts
··· 1 - import type { CancelReason } from '@vitest/runner' 2 1 import type { MockedModuleSerialized } from '@vitest/mocker' 2 + import type { CancelReason } from '@vitest/runner' 3 3 import { getBrowserState } from './utils' 4 4 5 5 export interface IframeDoneEvent {
+1 -1
packages/browser/src/client/client.ts
··· 1 1 import type { CancelReason } from '@vitest/runner' 2 + import type { WebSocketBrowserEvents, WebSocketBrowserHandlers } from '../node/types' 2 3 import { type BirpcReturn, createBirpc } from 'birpc' 3 4 import { parse, stringify } from 'flatted' 4 - import type { WebSocketBrowserEvents, WebSocketBrowserHandlers } from '../node/types' 5 5 import { getBrowserState } from './utils' 6 6 7 7 const PAGE_TYPE = getBrowserState().type
+6 -6
packages/browser/src/client/orchestrator.ts
··· 1 - import { channel, client } from '@vitest/browser/client' 2 - import { generateHash } from '@vitest/runner/utils' 3 - import { type GlobalChannelIncomingEvent, type IframeChannelEvent, type IframeChannelIncomingEvent, globalChannel } from '@vitest/browser/client' 4 - import { relative } from 'pathe' 5 1 import type { SerializedConfig } from 'vitest' 6 - import { getBrowserState, getConfig } from './utils' 7 - import { getUiAPI } from './ui' 2 + import { channel, client } from '@vitest/browser/client' 3 + import { globalChannel, type GlobalChannelIncomingEvent, type IframeChannelEvent, type IframeChannelIncomingEvent } from '@vitest/browser/client' 4 + import { generateHash } from '@vitest/runner/utils' 5 + import { relative } from 'pathe' 8 6 import { createModuleMockerInterceptor } from './tester/msw' 7 + import { getUiAPI } from './ui' 8 + import { getBrowserState, getConfig } from './utils' 9 9 10 10 const url = new URL(location.href) 11 11 const ID_ALL = '__vitest_all__'
+3 -3
packages/browser/src/client/vite.config.ts
··· 1 - import { fileURLToPath } from 'node:url' 2 1 import fs from 'node:fs' 3 - import { defineConfig } from 'vite' 2 + import { fileURLToPath } from 'node:url' 4 3 import { resolve } from 'pathe' 5 4 import { globSync } from 'tinyglobby' 5 + import { defineConfig } from 'vite' 6 6 7 7 export default defineConfig({ 8 8 server: { ··· 34 34 plugins: [ 35 35 { 36 36 name: 'copy-ui-plugin', 37 - /* eslint-disable no-console */ 37 + 38 38 closeBundle: async () => { 39 39 const root = resolve( 40 40 fileURLToPath(import.meta.url),
+4 -4
packages/browser/src/node/index.ts
··· 1 - import type { WorkspaceProject } from 'vitest/node' 2 1 import type { Plugin } from 'vitest/config' 3 - import { createViteLogger, createViteServer } from 'vitest/node' 2 + import type { WorkspaceProject } from 'vitest/node' 4 3 import c from 'tinyrainbow' 4 + import { createViteLogger, createViteServer } from 'vitest/node' 5 5 import { version } from '../../package.json' 6 + import BrowserPlugin from './plugin' 6 7 import { setupBrowserRpc } from './rpc' 7 8 import { BrowserServer } from './server' 8 - import BrowserPlugin from './plugin' 9 9 10 - export type { BrowserServer } from './server' 11 10 export { createBrowserPool } from './pool' 11 + export type { BrowserServer } from './server' 12 12 13 13 export async function createBrowserServer( 14 14 project: WorkspaceProject,
+10 -10
packages/browser/src/node/plugin.ts
··· 1 - import { fileURLToPath } from 'node:url' 2 - import { createRequire } from 'node:module' 3 - import { lstatSync, readFileSync } from 'node:fs' 4 1 import type { Stats } from 'node:fs' 2 + import type { WorkspaceProject } from 'vitest/node' 3 + import type { BrowserServer } from './server' 4 + import { lstatSync, readFileSync } from 'node:fs' 5 + import { createRequire } from 'node:module' 6 + import { fileURLToPath } from 'node:url' 7 + import { dynamicImportPlugin } from '@vitest/mocker/node' 8 + import { toArray } from '@vitest/utils' 9 + import MagicString from 'magic-string' 5 10 import { basename, dirname, extname, resolve } from 'pathe' 6 11 import sirv from 'sirv' 7 - import type { WorkspaceProject } from 'vitest/node' 12 + import { coverageConfigDefaults, type Plugin } from 'vitest/config' 8 13 import { getFilePoolName, resolveApiServerConfig, resolveFsAllow, distDir as vitestDist } from 'vitest/node' 9 - import { type Plugin, coverageConfigDefaults } from 'vitest/config' 10 - import { toArray } from '@vitest/utils' 11 - import { dynamicImportPlugin } from '@vitest/mocker/node' 12 - import MagicString from 'magic-string' 13 14 import BrowserContext from './plugins/pluginContext' 14 - import type { BrowserServer } from './server' 15 15 import { resolveOrchestrator } from './serverOrchestrator' 16 16 import { resolveTester } from './serverTester' 17 17 18 - export type { BrowserCommand } from 'vitest/node' 19 18 export { defineBrowserCommand } from './commands/utils' 19 + export type { BrowserCommand } from 'vitest/node' 20 20 21 21 export default (browserServer: BrowserServer, base = '/'): Plugin[] => { 22 22 const pkgRoot = resolve(fileURLToPath(import.meta.url), '../..')
+3 -3
packages/browser/src/node/pool.ts
··· 1 - import * as nodeos from 'node:os' 2 - import crypto from 'node:crypto' 3 - import { relative } from 'pathe' 4 1 import type { BrowserProvider, ProcessPool, Vitest, WorkspaceProject, WorkspaceSpec } from 'vitest/node' 2 + import crypto from 'node:crypto' 3 + import * as nodeos from 'node:os' 4 + import { relative } from 'pathe' 5 5 import { createDebugger } from 'vitest/node' 6 6 7 7 const debug = createDebugger('vitest:browser:pool')
+8 -8
packages/browser/src/node/rpc.ts
··· 1 + import type { ErrorWithDiff } from 'vitest' 2 + import type { BrowserCommandContext } from 'vitest/node' 3 + import type { WebSocket } from 'ws' 4 + import type { BrowserServer } from './server' 5 + import type { WebSocketBrowserEvents, WebSocketBrowserHandlers } from './types' 1 6 import { existsSync, promises as fs } from 'node:fs' 2 - import { dirname } from 'pathe' 7 + import { ServerMockResolver } from '@vitest/mocker/node' 3 8 import { createBirpc } from 'birpc' 4 9 import { parse, stringify } from 'flatted' 5 - import type { WebSocket } from 'ws' 6 - import { WebSocketServer } from 'ws' 7 - import type { BrowserCommandContext } from 'vitest/node' 10 + import { dirname } from 'pathe' 8 11 import { createDebugger, isFileServingAllowed } from 'vitest/node' 9 - import type { ErrorWithDiff } from 'vitest' 10 - import { ServerMockResolver } from '@vitest/mocker/node' 11 - import type { WebSocketBrowserEvents, WebSocketBrowserHandlers } from './types' 12 - import type { BrowserServer } from './server' 12 + import { WebSocketServer } from 'ws' 13 13 14 14 const debug = createDebugger('vitest:browser:api') 15 15
+7 -7
packages/browser/src/node/server.ts
··· 1 - import { readFile } from 'node:fs/promises' 2 - import { fileURLToPath } from 'node:url' 1 + import type { ErrorWithDiff } from '@vitest/utils' 2 + import type { SerializedConfig } from 'vitest' 3 3 import type { 4 4 BrowserProvider, 5 5 BrowserScript, ··· 8 8 Vite, 9 9 WorkspaceProject, 10 10 } from 'vitest/node' 11 - import { join, resolve } from 'pathe' 12 - import type { ErrorWithDiff } from '@vitest/utils' 11 + import { readFile } from 'node:fs/promises' 12 + import { fileURLToPath } from 'node:url' 13 13 import { slash } from '@vitest/utils' 14 - import { type StackTraceParserOptions, parseErrorStacktrace, parseStacktrace } from '@vitest/utils/source-map' 15 - import type { SerializedConfig } from 'vitest' 14 + import { parseErrorStacktrace, parseStacktrace, type StackTraceParserOptions } from '@vitest/utils/source-map' 15 + import { join, resolve } from 'pathe' 16 + import { BrowserServerCDPHandler } from './cdp' 16 17 import { BrowserServerState } from './state' 17 18 import { getBrowserProvider } from './utils' 18 - import { BrowserServerCDPHandler } from './cdp' 19 19 20 20 export class BrowserServer implements IBrowserServer { 21 21 public faviconUrl: string
+1 -1
packages/browser/src/node/serverTester.ts
··· 1 1 import type { IncomingMessage, ServerResponse } from 'node:http' 2 + import type { BrowserServer } from './server' 2 3 import crypto from 'node:crypto' 3 4 import { stringify } from 'flatted' 4 5 import { replacer } from './utils' 5 - import type { BrowserServer } from './server' 6 6 7 7 export async function resolveTester( 8 8 server: BrowserServer,
+2 -2
packages/browser/src/node/state.ts
··· 1 - import { createDefer } from '@vitest/utils' 2 1 import type { BrowserServerStateContext, BrowserServerState as IBrowserServerState } from 'vitest/node' 3 - import type { WebSocketBrowserRPC } from './types' 4 2 import type { BrowserServerCDPHandler } from './cdp' 3 + import type { WebSocketBrowserRPC } from './types' 4 + import { createDefer } from '@vitest/utils' 5 5 6 6 export class BrowserServerState implements IBrowserServerState { 7 7 public readonly orchestrators = new Map<string, WebSocketBrowserRPC>()
+2 -2
packages/mocker/src/browser/hints.ts
··· 1 1 import type { MaybeMockedDeep } from '@vitest/spy' 2 - import { createSimpleStackTrace } from '@vitest/utils' 3 - import { parseSingleStack } from '@vitest/utils/source-map' 4 2 import type { ModuleMockFactoryWithHelper, ModuleMockOptions } from '../types' 5 3 import type { ModuleMocker } from './mocker' 4 + import { createSimpleStackTrace } from '@vitest/utils' 5 + import { parseSingleStack } from '@vitest/utils/source-map' 6 6 7 7 export interface CompilerHintsOptions { 8 8 /**
+5 -5
packages/mocker/src/browser/index.ts
··· 1 + export { createCompilerHints } from './hints' 2 + export type { CompilerHintsOptions, ModuleMockerCompilerHints } from './hints' 1 3 export type { ModuleMockerInterceptor } from './interceptor' 2 - export { ModuleMocker } from './mocker' 3 4 export { ModuleMockerMSWInterceptor, type ModuleMockerMSWInterceptorOptions } from './interceptor-msw' 4 - export { ModuleMockerServerInterceptor } from './interceptor-native' 5 5 6 + export { ModuleMockerServerInterceptor } from './interceptor-native' 7 + export { ModuleMocker } from './mocker' 6 8 export type { 7 - ModuleMockerRPC, 8 9 ModuleMockerConfig, 10 + ModuleMockerRPC, 9 11 ResolveIdResult, 10 12 ResolveMockResul, 11 13 } from './mocker' 12 - export { createCompilerHints } from './hints' 13 - export type { CompilerHintsOptions, ModuleMockerCompilerHints } from './hints'
+5 -6
packages/mocker/src/browser/interceptor-msw.ts
··· 1 - import type { SetupWorker, StartOptions } from 'msw/browser' 2 1 import type { HttpHandler } from 'msw' 2 + import type { SetupWorker, StartOptions } from 'msw/browser' 3 3 import type { ManualMockedModule, MockedModule } from '../registry' 4 + import type { ModuleMockerInterceptor } from './interceptor' 4 5 import { MockerRegistry } from '../registry' 5 6 import { cleanUrl } from '../utils' 6 - import type { ModuleMockerInterceptor } from './interceptor' 7 7 8 8 export interface ModuleMockerMSWInterceptorOptions { 9 9 /** ··· 127 127 }), 128 128 ) 129 129 return worker.start(this.options.mswOptions) 130 + }).finally(() => { 131 + this.started = true 132 + this.startPromise = undefined 130 133 }) 131 - .finally(() => { 132 - this.started = true 133 - this.startPromise = undefined 134 - }) 135 134 await this.startPromise 136 135 } 137 136 }
+3 -3
packages/mocker/src/browser/mocker.ts
··· 1 - import { extname, join } from 'pathe' 2 1 import type { MockedModule, MockedModuleType } from '../registry' 3 - import { AutomockedModule, MockerRegistry, RedirectedModule } from '../registry' 4 2 import type { ModuleMockOptions } from '../types' 5 - import { mockObject } from '../automocker' 6 3 import type { ModuleMockerInterceptor } from './interceptor' 4 + import { extname, join } from 'pathe' 5 + import { mockObject } from '../automocker' 6 + import { AutomockedModule, MockerRegistry, RedirectedModule } from '../registry' 7 7 8 8 const { now } = Date 9 9
+3 -3
packages/mocker/src/browser/register.ts
··· 1 - import { spyOn } from '@vitest/spy' 2 1 import type { ModuleMockerCompilerHints } from './hints' 3 - import { createCompilerHints } from './hints' 4 - import { hot, rpc } from './utils' 5 2 import type { ModuleMockerInterceptor } from './index' 3 + import { spyOn } from '@vitest/spy' 4 + import { createCompilerHints } from './hints' 6 5 import { ModuleMocker } from './index' 6 + import { hot, rpc } from './utils' 7 7 8 8 declare const __VITEST_GLOBAL_THIS_ACCESSOR__: string 9 9 declare const __VITEST_MOCKER_ROOT__: string
+2 -2
packages/mocker/src/node/automockPlugin.ts
··· 1 - import MagicString from 'magic-string' 2 1 import type { Plugin } from 'vite' 2 + import MagicString from 'magic-string' 3 3 import { cleanUrl } from '../utils' 4 4 import { 5 5 type Declaration, 6 6 type ExportDefaultDeclaration, 7 7 type ExportNamedDeclaration, 8 8 type Expression, 9 + getArbitraryModuleIdentifier, 9 10 type Pattern, 10 11 type Positioned, 11 12 type Program, 12 - getArbitraryModuleIdentifier, 13 13 } from './esmWalker' 14 14 15 15 export interface AutomockPluginOptions {
+1 -1
packages/mocker/src/node/dynamicImportPlugin.ts
··· 1 1 import type { SourceMap } from 'magic-string' 2 - import MagicString from 'magic-string' 3 2 import type { Plugin, Rollup } from 'vite' 4 3 import type { Expression, Positioned } from './esmWalker' 4 + import MagicString from 'magic-string' 5 5 import { esmWalker } from './esmWalker' 6 6 7 7 const regexDynamicImport = /import\s*\(/
+2 -2
packages/mocker/src/node/esmWalker.ts
··· 1 1 import type { 2 + Node as _Node, 2 3 CallExpression, 3 4 Function as FunctionNode, 4 5 Identifier, ··· 7 8 Pattern, 8 9 Property, 9 10 VariableDeclaration, 10 - Node as _Node, 11 11 } from 'estree' 12 - import { walk as eswalk } from 'estree-walker' 13 12 import type { Rollup } from 'vite' 13 + import { walk as eswalk } from 'estree-walker' 14 14 15 15 export type * from 'estree' 16 16
+4 -4
packages/mocker/src/node/hoistMocksPlugin.ts
··· 1 - import type { SourceMap } from 'magic-string' 2 - import MagicString from 'magic-string' 3 1 import type { 4 2 AwaitExpression, 5 3 CallExpression, ··· 11 9 ImportExpression, 12 10 VariableDeclaration, 13 11 } from 'estree' 14 - import { findNodeAround } from 'acorn-walk' 12 + import type { SourceMap } from 'magic-string' 15 13 import type { Plugin, Rollup } from 'vite' 16 - import { createFilter } from 'vite' 17 14 import type { Node, Positioned } from './esmWalker' 15 + import { findNodeAround } from 'acorn-walk' 16 + import MagicString from 'magic-string' 17 + import { createFilter } from 'vite' 18 18 import { esmWalker, getArbitraryModuleIdentifier } from './esmWalker' 19 19 20 20 interface HoistMocksOptions {
+8 -8
packages/mocker/src/node/index.ts
··· 1 1 export { automockModule, automockPlugin } from './automockPlugin' 2 - export { findMockRedirect } from './redirect' 3 - export { hoistMocksPlugin, hoistMocks } from './hoistMocksPlugin' 4 - export { ServerMockResolver } from './resolver' 2 + export type { AutomockPluginOptions } from './automockPlugin' 5 3 export { dynamicImportPlugin } from './dynamicImportPlugin' 4 + export { hoistMocks, hoistMocksPlugin } from './hoistMocksPlugin' 5 + export type { HoistMocksPluginOptions, HoistMocksResult } from './hoistMocksPlugin' 6 6 export { interceptorPlugin } from './interceptorPlugin' 7 - export { mockerPlugin } from './mockerPlugin' 7 + export type { InterceptorPluginOptions } from './interceptorPlugin' 8 8 9 + export { mockerPlugin } from './mockerPlugin' 10 + export { findMockRedirect } from './redirect' 11 + export { ServerMockResolver } from './resolver' 9 12 export type { 10 - ServerMockResolution, 11 13 ServerIdResolution, 14 + ServerMockResolution, 12 15 ServerResolverOptions, 13 16 } from './resolver' 14 - export type { AutomockPluginOptions } from './automockPlugin' 15 - export type { HoistMocksPluginOptions, HoistMocksResult } from './hoistMocksPlugin' 16 - export type { InterceptorPluginOptions } from './interceptorPlugin'
+2 -2
packages/mocker/src/node/interceptorPlugin.ts
··· 1 - import { join } from 'node:path/posix' 2 - import { readFile } from 'node:fs/promises' 3 1 import type { Plugin } from 'vite' 4 2 import type { MockedModuleSerialized } from '../registry' 3 + import { readFile } from 'node:fs/promises' 4 + import { join } from 'node:path/posix' 5 5 import { ManualMockedModule, MockerRegistry } from '../registry' 6 6 import { cleanUrl } from '../utils' 7 7 import { automockModule } from './automockPlugin'
+5 -5
packages/mocker/src/node/mockerPlugin.ts
··· 1 - import { fileURLToPath } from 'node:url' 2 - import { readFile } from 'node:fs/promises' 3 1 import type { Plugin, ViteDevServer } from 'vite' 2 + import { readFile } from 'node:fs/promises' 3 + import { fileURLToPath } from 'node:url' 4 4 5 5 import { resolve } from 'pathe' 6 - import { type AutomockPluginOptions, automockPlugin } from './automockPlugin' 7 - import { type HoistMocksPluginOptions, hoistMocksPlugin } from './hoistMocksPlugin' 6 + import { automockPlugin, type AutomockPluginOptions } from './automockPlugin' 8 7 import { dynamicImportPlugin } from './dynamicImportPlugin' 9 - import { ServerMockResolver } from './resolver' 8 + import { hoistMocksPlugin, type HoistMocksPluginOptions } from './hoistMocksPlugin' 10 9 import { interceptorPlugin } from './interceptorPlugin' 10 + import { ServerMockResolver } from './resolver' 11 11 12 12 interface MockerPluginOptions extends AutomockPluginOptions { 13 13 hoistMocks?: HoistMocksPluginOptions
+2 -2
packages/mocker/src/node/resolver.ts
··· 1 - import { existsSync, readFileSync } from 'node:fs' 2 - import { isAbsolute, join, resolve } from 'pathe' 3 1 import type { PartialResolvedId } from 'rollup' 4 2 import type { ResolvedConfig as ViteConfig, ViteDevServer } from 'vite' 3 + import { existsSync, readFileSync } from 'node:fs' 4 + import { isAbsolute, join, resolve } from 'pathe' 5 5 import { cleanUrl } from '../utils' 6 6 import { findMockRedirect } from './redirect' 7 7
+1 -1
packages/pretty-format/src/plugins/AsymmetricMatcher.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import { printListItems, printObjectProperties } from '../collections' 9 8 import type { Config, NewPlugin, Printer, Refs } from '../types' 9 + import { printListItems, printObjectProperties } from '../collections' 10 10 11 11 const asymmetricMatcher 12 12 = typeof Symbol === 'function' && Symbol.for
+1 -1
packages/pretty-format/src/plugins/DOMCollection.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import { printListItems, printObjectProperties } from '../collections' 9 8 import type { Config, NewPlugin, Printer, Refs } from '../types' 9 + import { printListItems, printObjectProperties } from '../collections' 10 10 11 11 const SPACE = ' ' 12 12
+1 -1
packages/pretty-format/src/plugins/Immutable.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import { printIteratorEntries, printIteratorValues } from '../collections' 9 8 import type { Config, NewPlugin, Printer, Refs } from '../types' 9 + import { printIteratorEntries, printIteratorValues } from '../collections' 10 10 11 11 // SENTINEL constants are from https://github.com/facebook/immutable-js 12 12 const IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'
+1 -1
packages/pretty-format/src/plugins/ReactElement.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import * as ReactIs from 'react-is' 9 8 import type { Config, NewPlugin, Printer, Refs } from '../types' 9 + import * as ReactIs from 'react-is' 10 10 import { 11 11 printChildren, 12 12 printElement,
+1 -1
packages/runner/src/types/tasks.ts
··· 1 1 import type { Awaitable, ErrorWithDiff } from '@vitest/utils' 2 - import type { ChainableFunction } from '../utils/chain' 3 2 import type { FixtureItem } from '../fixture' 3 + import type { ChainableFunction } from '../utils/chain' 4 4 5 5 export type RunMode = 'run' | 'skip' | 'only' | 'todo' 6 6 export type TaskState = RunMode | 'pass' | 'fail'
+1 -1
packages/runner/src/utils/collect.ts
··· 1 + import type { File, Suite, TaskBase } from '../types/tasks' 1 2 import { processError } from '@vitest/utils/error' 2 3 import { relative } from 'pathe' 3 - import type { File, Suite, TaskBase } from '../types/tasks' 4 4 5 5 /** 6 6 * If any tasks been marked as `only`, mark all other tasks as `skip`.
+12 -12
packages/runner/src/utils/index.ts
··· 1 + export { type ChainableFunction, createChainable } from './chain' 1 2 export { 2 - interpretTaskModes, 3 - someTasksAreOnly, 4 - generateHash, 5 3 calculateSuiteHash, 6 4 createFileTask, 5 + generateHash, 6 + interpretTaskModes, 7 + someTasksAreOnly, 7 8 } from './collect' 9 + export { limitConcurrency } from './limit-concurrency' 8 10 export { partitionSuiteChildren } from './suite' 9 11 export { 10 - isAtomTest, 11 - getTests, 12 - getTasks, 13 - getSuites, 14 - hasTests, 15 - hasFailed, 16 - getNames, 17 12 getFullName, 13 + getNames, 14 + getSuites, 15 + getTasks, 18 16 getTestName, 17 + getTests, 18 + hasFailed, 19 + hasTests, 20 + isAtomTest, 19 21 } from './tasks' 20 - export { createChainable, type ChainableFunction } from './chain' 21 - export { limitConcurrency } from './limit-concurrency'
+1 -1
packages/runner/src/utils/tasks.ts
··· 1 - import { type Arrayable, toArray } from '@vitest/utils' 2 1 import type { Custom, Suite, Task, Test } from '../types/tasks' 2 + import { type Arrayable, toArray } from '@vitest/utils' 3 3 4 4 export function isAtomTest(s: Task): s is Test | Custom { 5 5 return s.type === 'test' || s.type === 'custom'
+1 -1
packages/snapshot/src/env/node.ts
··· 1 + import type { SnapshotEnvironment, SnapshotEnvironmentOptions } from '../types' 1 2 import { existsSync, promises as fs } from 'node:fs' 2 3 import { basename, dirname, isAbsolute, join, resolve } from 'pathe' 3 - import type { SnapshotEnvironment, SnapshotEnvironmentOptions } from '../types' 4 4 5 5 export class NodeSnapshotEnvironment implements SnapshotEnvironment { 6 6 constructor(private options: SnapshotEnvironmentOptions = {}) {}
+1 -1
packages/snapshot/src/port/inlineSnapshot.ts
··· 1 1 import type MagicString from 'magic-string' 2 + import type { SnapshotEnvironment } from '../types' 2 3 import { 3 4 getCallLastIndex, 4 5 lineSplitRE, 5 6 offsetToLineNumber, 6 7 positionToOffset, 7 8 } from '../../../utils/src/index' 8 - import type { SnapshotEnvironment } from '../types' 9 9 10 10 export interface InlineSnapshot { 11 11 snapshot: string
+2 -2
packages/snapshot/src/port/state.ts
··· 7 7 8 8 import type { OptionsReceived as PrettyFormatOptions } from '@vitest/pretty-format' 9 9 import type { ParsedStack } from '../../../utils/src/index' 10 - import { parseErrorStacktrace } from '../../../utils/src/source-map' 11 10 import type { 12 11 SnapshotData, 13 12 SnapshotEnvironment, ··· 17 16 SnapshotUpdateState, 18 17 } from '../types' 19 18 import type { InlineSnapshot } from './inlineSnapshot' 20 - import { saveInlineSnapshots } from './inlineSnapshot' 21 19 import type { RawSnapshot, RawSnapshotInfo } from './rawSnapshot' 20 + import { parseErrorStacktrace } from '../../../utils/src/source-map' 21 + import { saveInlineSnapshots } from './inlineSnapshot' 22 22 import { saveRawSnapshots } from './rawSnapshot' 23 23 24 24 import {
+3 -3
packages/snapshot/src/port/utils.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import naturalCompare from 'natural-compare' 9 8 import type { OptionsReceived as PrettyFormatOptions } from '@vitest/pretty-format' 10 - import { format as prettyFormat } from '@vitest/pretty-format' 11 - import { isObject } from '../../../utils/src/index' 12 9 import type { SnapshotData, SnapshotStateOptions } from '../types' 13 10 import type { SnapshotEnvironment } from '../types/environment' 11 + import { format as prettyFormat } from '@vitest/pretty-format' 12 + import naturalCompare from 'natural-compare' 13 + import { isObject } from '../../../utils/src/index' 14 14 import { getSerializers } from './plugins' 15 15 16 16 // TODO: rewrite and clean up
+2 -2
packages/ui/client/components/FileDetails.vue
··· 7 7 currentLogs, 8 8 isReport, 9 9 } from '~/composables/client' 10 - import type { Params } from '~/composables/params' 11 - import { viewMode } from '~/composables/params' 12 10 import type { ModuleGraph } from '~/composables/module-graph' 13 11 import { getModuleGraph } from '~/composables/module-graph' 12 + import type { Params } from '~/composables/params' 13 + import { viewMode } from '~/composables/params' 14 14 import { getProjectNameColor } from '~/utils/task' 15 15 16 16 const graph = ref<ModuleGraph>({ nodes: [], links: [] })
+5 -5
packages/ui/client/components/Navigation.vue
··· 1 1 <script setup lang="ts"> 2 - import { Tooltip as VueTooltip } from 'floating-vue' 3 2 import type { File } from 'vitest' 3 + import { Tooltip as VueTooltip } from 'floating-vue' 4 + import { isDark, toggleDark } from '~/composables' 5 + import { client, isReport, runAll, runFiles } from '~/composables/client' 6 + import { explorerTree } from '~/composables/explorer' 7 + import { initialized, shouldShowExpandAll } from '~/composables/explorer/state' 4 8 import { 5 9 coverageConfigured, 6 10 coverageEnabled, ··· 11 15 showCoverage, 12 16 showDashboard, 13 17 } from '~/composables/navigation' 14 - import { client, isReport, runAll, runFiles } from '~/composables/client' 15 - import { isDark, toggleDark } from '~/composables' 16 - import { explorerTree } from '~/composables/explorer' 17 - import { initialized, shouldShowExpandAll } from '~/composables/explorer/state' 18 18 19 19 function updateSnapshot() { 20 20 return client.rpc.updateSnapshot()
+1 -1
packages/ui/client/components/ProgressBar.vue
··· 1 1 <script setup lang="ts"> 2 - import { explorerTree } from '~/composables/explorer' 3 2 import { finished } from '~/composables/client/state' 3 + import { explorerTree } from '~/composables/explorer' 4 4 5 5 const { width } = useWindowSize() 6 6 const classes = computed(() => {
+1 -1
packages/ui/client/composables/api.ts
··· 1 1 import type { BrowserUI } from 'vitest' 2 - import { findById } from './client' 3 2 import { viewport } from './browser' 3 + import { findById } from './client' 4 4 5 5 export const ui: BrowserUI = { 6 6 setCurrentFileId(fileId: string) {
+5 -5
packages/ui/client/composables/codemirror.ts
··· 1 + import type { Task } from '@vitest/runner' 1 2 import type { Ref, WritableComputedRef } from 'vue' 2 - import { watch } from 'vue' 3 3 import CodeMirror from 'codemirror' 4 - import 'codemirror/mode/javascript/javascript' 4 + import { watch } from 'vue' 5 5 6 + import { navigateTo } from '~/composables/navigation' 7 + 8 + import 'codemirror/mode/javascript/javascript' 6 9 // import 'codemirror/mode/css/css' 7 10 import 'codemirror/mode/xml/xml' 8 - 9 11 // import 'codemirror/mode/htmlmixed/htmlmixed' 10 12 import 'codemirror/mode/jsx/jsx' 11 13 import 'codemirror/addon/display/placeholder' 12 14 import 'codemirror/addon/scroll/simplescrollbars' 13 15 import 'codemirror/addon/scroll/simplescrollbars.css' 14 - import type { Task } from '@vitest/runner' 15 - import { navigateTo } from '~/composables/navigation' 16 16 17 17 export const codemirrorRef = shallowRef<CodeMirror.EditorFromTextArea>() 18 18
+1 -1
packages/ui/client/composables/error.ts
··· 1 - import Filter from 'ansi-to-html' 2 1 import type { ErrorWithDiff } from 'vitest' 3 2 import { parseStacktrace } from '@vitest/utils/source-map' 3 + import Filter from 'ansi-to-html' 4 4 5 5 export function shouldOpenInEditor(name: string, fileName?: string) { 6 6 return fileName && name.endsWith(fileName)
+1 -1
packages/ui/client/composables/module-graph.ts
··· 5 5 GraphLink, 6 6 GraphNode, 7 7 } from 'd3-graph-controller' 8 - import { defineGraph, defineLink, defineNode } from 'd3-graph-controller' 9 8 import type { ModuleGraphData } from 'vitest' 9 + import { defineGraph, defineLink, defineNode } from 'd3-graph-controller' 10 10 11 11 export type ModuleType = 'external' | 'inline' 12 12 export type ModuleNode = GraphNode<ModuleType>
+3 -3
packages/utils/src/diff/cleanupSemantic.ts
··· 611 611 612 612 export { 613 613 Diff, 614 - DIFF_EQUAL, 615 - DIFF_DELETE, 616 - DIFF_INSERT, 617 614 diff_cleanupSemantic as cleanupSemantic, 615 + DIFF_DELETE, 616 + DIFF_EQUAL, 617 + DIFF_INSERT, 618 618 }
+2 -2
packages/utils/src/diff/diffLines.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 + import type { DiffOptions, DiffOptionsNormalized } from './types' 8 9 import diffSequences from 'diff-sequences' 9 - import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic' 10 + import { Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from './cleanupSemantic' 10 11 import { 11 12 joinAlignedDiffsExpand, 12 13 joinAlignedDiffsNoExpand, 13 14 } from './joinAlignedDiffs' 14 15 import { normalizeDiffOptions } from './normalizeDiffOptions' 15 - import type { DiffOptions, DiffOptionsNormalized } from './types' 16 16 17 17 function isEmptyString(lines: Array<string>) { 18 18 return lines.length === 1 && lines[0].length === 0
+2 -2
packages/utils/src/diff/diffStrings.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import diffSequences from 'diff-sequences' 9 - import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic' 10 8 import type { DiffOptions } from './types' 9 + import diffSequences from 'diff-sequences' 10 + import { Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from './cleanupSemantic' 11 11 12 12 // platforms compatible 13 13 function getNewLineSymbol(string: string) {
+1 -1
packages/utils/src/diff/getAlignedDiffs.ts
··· 5 5 * LICENSE file in the root directory of this source tree. 6 6 */ 7 7 8 - import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic' 9 8 import type { DiffOptionsColor } from './types' 9 + import { Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from './cleanupSemantic' 10 10 11 11 // Given change op and array of diffs, return concatenated string: 12 12 // * include common strings
+4 -4
packages/utils/src/diff/index.ts
··· 8 8 // This is a fork of Jest's jest-diff package, but it doesn't depend on Node environment (like chalk). 9 9 10 10 import type { PrettyFormatOptions } from '@vitest/pretty-format' 11 + import type { DiffOptions } from './types' 11 12 import { 12 13 format as prettyFormat, 13 14 plugins as prettyFormatPlugins, ··· 15 16 import c from 'tinyrainbow' 16 17 import { stringify } from '../display' 17 18 import { deepClone, getOwnProperties, getType as getSimpleType } from '../helpers' 18 - import { getType } from './getType' 19 - import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic' 19 + import { Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from './cleanupSemantic' 20 20 import { NO_DIFF_MESSAGE, SIMILAR_MESSAGE } from './constants' 21 21 import { diffLinesRaw, diffLinesUnified, diffLinesUnified2 } from './diffLines' 22 + import { getType } from './getType' 22 23 import { normalizeDiffOptions } from './normalizeDiffOptions' 23 24 import { diffStringsRaw, diffStringsUnified } from './printDiffs' 24 - import type { DiffOptions } from './types' 25 25 26 26 export type { DiffOptions, DiffOptionsColor } from './types' 27 27 28 28 export { diffLinesRaw, diffLinesUnified, diffLinesUnified2 } 29 29 export { diffStringsRaw, diffStringsUnified } 30 - export { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } 30 + export { Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } 31 31 32 32 function getCommonMessage(message: string, options?: DiffOptions) { 33 33 const { commonColor } = normalizeDiffOptions(options)
+1 -1
packages/utils/src/diff/joinAlignedDiffs.ts
··· 6 6 */ 7 7 8 8 import type { Diff } from './cleanupSemantic' 9 - import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from './cleanupSemantic' 10 9 import type { DiffOptionsColor, DiffOptionsNormalized } from './types' 10 + import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from './cleanupSemantic' 11 11 12 12 function formatTrailingSpaces( 13 13 line: string,
+1 -1
packages/utils/src/diff/normalizeDiffOptions.ts
··· 6 6 */ 7 7 8 8 import type { CompareKeys } from '@vitest/pretty-format' 9 - import c from 'tinyrainbow' 10 9 import type { DiffOptions, DiffOptionsNormalized } from './types' 10 + import c from 'tinyrainbow' 11 11 12 12 export const noColor = (string: string): string => string 13 13
+2 -2
packages/utils/src/diff/printDiffs.ts
··· 6 6 */ 7 7 8 8 import type { Diff } from './cleanupSemantic' 9 - import { DIFF_EQUAL, cleanupSemantic } from './cleanupSemantic' 9 + import type { DiffOptions } from './types' 10 + import { cleanupSemantic, DIFF_EQUAL } from './cleanupSemantic' 10 11 import { diffLinesUnified, printDiffLines } from './diffLines' 11 12 import diffStrings from './diffStrings' 12 13 import getAlignedDiffs from './getAlignedDiffs' 13 14 import { normalizeDiffOptions } from './normalizeDiffOptions' 14 - import type { DiffOptions } from './types' 15 15 16 16 function hasCommonDiff(diffs: Array<Diff>, isMultiline: boolean): boolean { 17 17 if (isMultiline) {
+1 -1
packages/vite-node/src/hmr/emitter.ts
··· 1 - import { EventEmitter } from 'node:events' 2 1 import type { HMRPayload, Plugin } from 'vite' 2 + import { EventEmitter } from 'node:events' 3 3 4 4 export type EventType = string | symbol 5 5 export type Handler<T = unknown> = (event: T) => void
+4 -4
packages/vite-node/src/hmr/hmr.ts
··· 1 1 /* eslint-disable no-console */ 2 2 3 - import type { HMRPayload, Update } from 'vite/types/hmrPayload.js' 4 3 import type { CustomEventMap } from 'vite/types/customEvent.js' 5 - import c from 'tinyrainbow' 6 - import createDebug from 'debug' 4 + import type { HMRPayload, Update } from 'vite/types/hmrPayload.js' 7 5 import type { ViteNodeRunner } from '../client' 8 6 import type { HotContext } from '../types' 9 - import { normalizeRequestId } from '../utils' 10 7 import type { HMREmitter } from './emitter' 8 + import createDebug from 'debug' 9 + import c from 'tinyrainbow' 10 + import { normalizeRequestId } from '../utils' 11 11 12 12 export type ModuleNamespace = Record<string, any> & { 13 13 [Symbol.toStringTag]: 'Module'
+13 -13
packages/vitest/src/api/setup.ts
··· 1 - import { existsSync, promises as fs } from 'node:fs' 2 - 3 - import { createBirpc } from 'birpc' 4 - import { parse, stringify } from 'flatted' 5 - import type { WebSocket } from 'ws' 6 - import { WebSocketServer } from 'ws' 7 - import type { ViteDevServer } from 'vite' 8 1 import type { File, TaskResultPack } from '@vitest/runner' 9 - import { isPrimitive, noop } from '@vitest/utils' 10 - import { API_PATH } from '../constants' 2 + 3 + import type { ViteDevServer } from 'vite' 4 + import type { WebSocket } from 'ws' 11 5 import type { Vitest } from '../node/core' 12 - import type { Awaitable, ModuleGraphData, UserConsoleLog } from '../types/general' 13 6 import type { Reporter } from '../node/types/reporter' 14 - import { getModuleGraph } from '../utils/graph' 15 - import { stringifyReplace } from '../utils/serialization' 16 - import { parseErrorStacktrace } from '../utils/source-map' 17 7 import type { SerializedTestSpecification } from '../runtime/types/utils' 8 + import type { Awaitable, ModuleGraphData, UserConsoleLog } from '../types/general' 18 9 import type { 19 10 TransformResultWithSource, 20 11 WebSocketEvents, 21 12 WebSocketHandlers, 22 13 WebSocketRPC, 23 14 } from './types' 15 + import { existsSync, promises as fs } from 'node:fs' 16 + import { isPrimitive, noop } from '@vitest/utils' 17 + import { createBirpc } from 'birpc' 18 + import { parse, stringify } from 'flatted' 19 + import { WebSocketServer } from 'ws' 20 + import { API_PATH } from '../constants' 21 + import { getModuleGraph } from '../utils/graph' 22 + import { stringifyReplace } from '../utils/serialization' 23 + import { parseErrorStacktrace } from '../utils/source-map' 24 24 25 25 export function setup(ctx: Vitest, _server?: ViteDevServer) { 26 26 const wss = new WebSocketServer({ noServer: true })
+2 -2
packages/vitest/src/api/types.ts
··· 1 - import type { BirpcReturn } from 'birpc' 2 1 import type { File, TaskResultPack } from '@vitest/runner' 3 - import type { Awaitable, ModuleGraphData, UserConsoleLog } from '../types/general' 2 + import type { BirpcReturn } from 'birpc' 4 3 import type { SerializedConfig } from '../runtime/config' 5 4 import type { SerializedTestSpecification } from '../runtime/types/utils' 5 + import type { Awaitable, ModuleGraphData, UserConsoleLog } from '../types/general' 6 6 7 7 interface SourceMap { 8 8 file: string
+1 -1
packages/vitest/src/integrations/coverage.ts
··· 1 - import type { SerializedCoverageConfig } from '../runtime/config' 2 1 import type { 3 2 CoverageProvider, 4 3 CoverageProviderModule, 5 4 } from '../node/types/coverage' 5 + import type { SerializedCoverageConfig } from '../runtime/config' 6 6 7 7 interface Loader { 8 8 executeId: (id: string) => Promise<{ default: CoverageProviderModule }>
+5 -5
packages/vitest/src/integrations/vi.ts
··· 1 1 import type { FakeTimerInstallOpts } from '@sinonjs/fake-timers' 2 - import { assertTypes, createSimpleStackTrace } from '@vitest/utils' 3 - import { parseSingleStack } from '../utils/source-map' 4 - import type { VitestMocker } from '../runtime/mocker' 5 2 import type { RuntimeOptions, SerializedConfig } from '../runtime/config' 3 + import type { VitestMocker } from '../runtime/mocker' 6 4 import type { MockFactoryWithHelper, MockOptions } from '../types/mocker' 7 - import { getWorkerState, isChildProcess, resetModules, waitForImportsToResolve } from '../runtime/utils' 8 - import { FakeTimers } from './mock/timers' 9 5 import type { 10 6 MaybeMocked, 11 7 MaybeMockedDeep, ··· 13 9 MaybePartiallyMockedDeep, 14 10 MockInstance, 15 11 } from './spy' 12 + import { assertTypes, createSimpleStackTrace } from '@vitest/utils' 13 + import { getWorkerState, isChildProcess, resetModules, waitForImportsToResolve } from '../runtime/utils' 14 + import { parseSingleStack } from '../utils/source-map' 15 + import { FakeTimers } from './mock/timers' 16 16 import { fn, isMockFunction, mocks, spyOn } from './spy' 17 17 import { waitFor, waitUntil } from './wait' 18 18
+24 -24
packages/vitest/src/node/core.ts
··· 1 - import { existsSync, promises as fs } from 'node:fs' 1 + import type { CancelReason, File, TaskResultPack } from '@vitest/runner' 2 2 import type { Writable } from 'node:stream' 3 3 import type { ViteDevServer } from 'vite' 4 - import { dirname, join, normalize, relative } from 'pathe' 5 - import mm from 'micromatch' 6 - import { ViteNodeRunner } from 'vite-node/client' 7 - import { SnapshotManager } from '@vitest/snapshot/manager' 8 - import type { CancelReason, File, TaskResultPack } from '@vitest/runner' 9 - import { ViteNodeServer } from 'vite-node/server' 10 4 import type { defineWorkspace } from 'vitest/config' 11 - import { noop, slash, toArray } from '@vitest/utils' 12 - import { getTasks, hasFailed } from '@vitest/runner/utils' 13 - import { version } from '../../package.json' with { type: 'json' } 14 - import { getCoverageProvider } from '../integrations/coverage' 15 - import { defaultBrowserPort, workspacesFiles as workspaceFiles } from '../constants' 16 - import { WebSocketReporter } from '../api/setup' 17 5 import type { SerializedCoverageConfig } from '../runtime/config' 18 6 import type { ArgumentsType, OnServerRestartHandler, ProvidedContext, UserConsoleLog } from '../types/general' 7 + import type { ProcessPool, WorkspaceSpec } from './pool' 8 + import type { TestSpecification } from './spec' 9 + import type { ResolvedConfig, UserConfig, VitestRunMode } from './types/config' 10 + import type { CoverageProvider } from './types/coverage' 11 + import type { Reporter } from './types/reporter' 12 + import { existsSync, promises as fs } from 'node:fs' 13 + import { getTasks, hasFailed } from '@vitest/runner/utils' 14 + import { SnapshotManager } from '@vitest/snapshot/manager' 15 + import { noop, slash, toArray } from '@vitest/utils' 16 + import mm from 'micromatch' 17 + import { dirname, join, normalize, relative } from 'pathe' 18 + import { ViteNodeRunner } from 'vite-node/client' 19 + import { ViteNodeServer } from 'vite-node/server' 20 + import { version } from '../../package.json' with { type: 'json' } 21 + import { WebSocketReporter } from '../api/setup' 22 + import { defaultBrowserPort, workspacesFiles as workspaceFiles } from '../constants' 23 + import { getCoverageProvider } from '../integrations/coverage' 19 24 import { distDir } from '../paths' 20 25 import { wildcardPatternToRegExp } from '../utils/base' 21 - import type { ProcessPool, WorkspaceSpec } from './pool' 26 + import { VitestCache } from './cache' 27 + import { resolveConfig } from './config/resolveConfig' 28 + import { FilesNotFoundError, GitNotFoundError } from './errors' 29 + import { Logger } from './logger' 30 + import { VitestPackageInstaller } from './packageInstaller' 22 31 import { createPool, getFilePoolName } from './pool' 32 + import { BlobReporter, readBlobs } from './reporters/blob' 23 33 import { createBenchmarkReporters, createReporters } from './reporters/utils' 24 34 import { StateManager } from './state' 25 - import { resolveConfig } from './config/resolveConfig' 26 - import { Logger } from './logger' 27 - import { VitestCache } from './cache' 28 35 import { WorkspaceProject } from './workspace' 29 - import { VitestPackageInstaller } from './packageInstaller' 30 - import { BlobReporter, readBlobs } from './reporters/blob' 31 - import { FilesNotFoundError, GitNotFoundError } from './errors' 32 - import type { ResolvedConfig, UserConfig, VitestRunMode } from './types/config' 33 - import type { Reporter } from './types/reporter' 34 - import type { CoverageProvider } from './types/coverage' 35 36 import { resolveWorkspace } from './workspace/resolveWorkspace' 36 - import type { TestSpecification } from './spec' 37 37 38 38 const WATCHER_DEBOUNCE = 100 39 39
+5 -5
packages/vitest/src/node/create.ts
··· 1 - import { resolve } from 'pathe' 2 - import { mergeConfig } from 'vite' 3 1 import type { 4 2 InlineConfig as ViteInlineConfig, 5 3 UserConfig as ViteUserConfig, 6 4 } from 'vite' 7 - import { findUp } from 'find-up' 8 - import { configFiles } from '../constants' 9 5 import type { VitestOptions } from './core' 6 + import type { UserConfig, VitestRunMode } from './types/config' 7 + import { findUp } from 'find-up' 8 + import { resolve } from 'pathe' 9 + import { mergeConfig } from 'vite' 10 + import { configFiles } from '../constants' 10 11 import { Vitest } from './core' 11 12 import { VitestPlugin } from './plugins' 12 13 import { createViteServer } from './vite' 13 - import type { UserConfig, VitestRunMode } from './types/config' 14 14 15 15 export async function createVitest( 16 16 mode: VitestRunMode,
+8 -8
packages/vitest/src/node/error.ts
··· 1 + import type { ErrorWithDiff, ParsedStack } from '@vitest/utils' 2 + import type { Vitest } from './core' 3 + import type { ErrorOptions } from './logger' 4 + import type { WorkspaceProject } from './workspace' 1 5 /* eslint-disable prefer-template */ 2 6 import { existsSync, readFileSync } from 'node:fs' 3 7 import { Writable } from 'node:stream' 4 8 import { stripVTControlCharacters } from 'node:util' 9 + import { inspect, isPrimitive } from '@vitest/utils' 10 + import cliTruncate from 'cli-truncate' 5 11 import { normalize, relative } from 'pathe' 6 12 import c from 'tinyrainbow' 7 - import cliTruncate from 'cli-truncate' 8 - import type { ErrorWithDiff, ParsedStack } from '@vitest/utils' 9 - import { inspect, isPrimitive } from '@vitest/utils' 13 + import { TypeCheckError } from '../typecheck/typechecker' 10 14 import { 11 15 lineSplitRE, 12 16 positionToOffset, 13 17 } from '../utils/source-map' 14 - import { TypeCheckError } from '../typecheck/typechecker' 15 - import type { Vitest } from './core' 16 - import { divider } from './reporters/renderers/utils' 17 - import type { ErrorOptions } from './logger' 18 18 import { Logger } from './logger' 19 - import type { WorkspaceProject } from './workspace' 20 19 import { F_POINTER } from './reporters/renderers/figures' 20 + import { divider } from './reporters/renderers/utils' 21 21 22 22 interface PrintErrorOptions { 23 23 type?: string
+1 -1
packages/vitest/src/node/git.ts
··· 1 - import { resolve } from 'pathe' 2 1 import type { Output } from 'tinyexec' 2 + import { resolve } from 'pathe' 3 3 import { x } from 'tinyexec' 4 4 5 5 export interface GitOptions {
+1 -1
packages/vitest/src/node/globalSetup.ts
··· 1 - import { toArray } from '@vitest/utils' 2 1 import type { ViteNodeRunner } from 'vite-node/client' 3 2 import type { ProvidedContext } from '../types/general' 4 3 import type { ResolvedConfig } from './types/config' 4 + import { toArray } from '@vitest/utils' 5 5 6 6 export interface GlobalSetupContext { 7 7 config: ResolvedConfig
+10 -10
packages/vitest/src/node/logger.ts
··· 1 - import { Console } from 'node:console' 2 - import type { Writable } from 'node:stream' 3 - import { createLogUpdate } from 'log-update' 4 - import c from 'tinyrainbow' 5 - import { parseErrorStacktrace } from '@vitest/utils/source-map' 6 1 import type { Task } from '@vitest/runner' 7 2 import type { ErrorWithDiff } from '@vitest/utils' 8 - import { toArray } from '@vitest/utils' 3 + import type { Writable } from 'node:stream' 9 4 import type { TypeCheckError } from '../typecheck/typechecker' 10 - import { highlightCode } from '../utils/colors' 11 - import { divider } from './reporters/renderers/utils' 12 - import { RandomSequencer } from './sequencers/RandomSequencer' 13 5 import type { Vitest } from './core' 14 6 import type { PrintErrorResult } from './error' 15 - import { printError } from './error' 16 7 import type { WorkspaceProject } from './workspace' 8 + import { Console } from 'node:console' 9 + import { toArray } from '@vitest/utils' 10 + import { parseErrorStacktrace } from '@vitest/utils/source-map' 11 + import { createLogUpdate } from 'log-update' 12 + import c from 'tinyrainbow' 13 + import { highlightCode } from '../utils/colors' 14 + import { printError } from './error' 15 + import { divider } from './reporters/renderers/utils' 16 + import { RandomSequencer } from './sequencers/RandomSequencer' 17 17 18 18 export interface ErrorOptions { 19 19 type?: string
+2 -2
packages/vitest/src/node/packageInstaller.ts
··· 1 - import url from 'node:url' 2 1 import { createRequire } from 'node:module' 3 - import c from 'tinyrainbow' 2 + import url from 'node:url' 4 3 import { isPackageExists } from 'local-pkg' 4 + import c from 'tinyrainbow' 5 5 import { isCI } from '../utils/env' 6 6 7 7 const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+6 -6
packages/vitest/src/node/pool.ts
··· 1 - import mm from 'micromatch' 2 1 import type { Awaitable } from '@vitest/utils' 3 - import { isWindows } from '../utils/env' 4 - import type { BuiltinPool, Pool } from './types/pool-options' 5 2 import type { Vitest } from './core' 3 + import type { TestSpecification } from './spec' 4 + import type { BuiltinPool, Pool } from './types/pool-options' 5 + import type { WorkspaceProject } from './workspace' 6 + import mm from 'micromatch' 7 + import { isWindows } from '../utils/env' 6 8 import { createForksPool } from './pools/forks' 7 9 import { createThreadsPool } from './pools/threads' 8 - import { createVmThreadsPool } from './pools/vmThreads' 9 - import type { WorkspaceProject } from './workspace' 10 10 import { createTypecheckPool } from './pools/typecheck' 11 11 import { createVmForksPool } from './pools/vmForks' 12 - import type { TestSpecification } from './spec' 12 + import { createVmThreadsPool } from './pools/vmThreads' 13 13 14 14 /** 15 15 * @deprecated use TestSpecification instead
+1 -1
packages/vitest/src/node/reported-workspace-project.ts
··· 1 1 import type { ProvidedContext } from '../types/general' 2 + import type { Vitest } from './core' 2 3 import type { ResolvedConfig, ResolvedProjectConfig, SerializedConfig } from './types/config' 3 4 import type { WorkspaceProject } from './workspace' 4 - import type { Vitest } from './core' 5 5 6 6 export class TestProject { 7 7 /**
+1 -1
packages/vitest/src/node/state.ts
··· 1 1 import type { File, Task, TaskResultPack } from '@vitest/runner' 2 - import { createFileTask } from '@vitest/runner/utils' 3 2 import type { UserConsoleLog } from '../types/general' 4 3 import type { WorkspaceProject } from './workspace' 4 + import { createFileTask } from '@vitest/runner/utils' 5 5 import { TestCase, TestModule, TestSuite } from './reporters/reported-tasks' 6 6 7 7 function isAggregateError(err: unknown): err is AggregateError {
+8 -8
packages/vitest/src/node/stdin.ts
··· 1 - import readline from 'node:readline' 2 1 import type { Writable } from 'node:stream' 3 - import c from 'tinyrainbow' 4 - import prompt from 'prompts' 5 - import { relative, resolve } from 'pathe' 6 - import { toArray } from '@vitest/utils' 7 - import { getTests } from '@vitest/runner/utils' 8 - import { isWindows } from '../utils/env' 9 - import { stdout } from '../utils/base' 10 2 import type { Vitest } from './core' 3 + import readline from 'node:readline' 4 + import { getTests } from '@vitest/runner/utils' 5 + import { toArray } from '@vitest/utils' 6 + import { relative, resolve } from 'pathe' 7 + import prompt from 'prompts' 8 + import c from 'tinyrainbow' 9 + import { stdout } from '../utils/base' 10 + import { isWindows } from '../utils/env' 11 11 import { WatchFilter } from './watch-filter' 12 12 13 13 const keys = [
+2 -2
packages/vitest/src/node/viteLogger.ts
··· 1 - import type { LogErrorOptions, LogLevel, LogType, Logger, LoggerOptions } from 'vite' 2 1 import type { RollupError } from 'rollup' 3 - import colors from 'tinyrainbow' 2 + import type { LogErrorOptions, Logger, LoggerOptions, LogLevel, LogType } from 'vite' 4 3 import type { Logger as VitestLogger } from './logger' 4 + import colors from 'tinyrainbow' 5 5 6 6 const LogLevels: Record<LogLevel, number> = { 7 7 silent: 0,
+2 -2
packages/vitest/src/node/watch-filter.ts
··· 1 - import readline from 'node:readline' 2 1 import type { Writable } from 'node:stream' 2 + import readline from 'node:readline' 3 3 import { stripVTControlCharacters } from 'node:util' 4 - import c from 'tinyrainbow' 5 4 import { createDefer } from '@vitest/utils' 5 + import c from 'tinyrainbow' 6 6 import { stdout as getStdout } from '../utils/base' 7 7 8 8 const MAX_RESULT_COUNT = 10
+25 -25
packages/vitest/src/node/workspace.ts
··· 1 + import type { 2 + TransformResult, 3 + ViteDevServer, 4 + InlineConfig as ViteInlineConfig, 5 + } from 'vite' 6 + import type { Typechecker } from '../typecheck/typechecker' 7 + import type { ProvidedContext } from '../types/general' 8 + import type { Vitest } from './core' 9 + import type { GlobalSetupFile } from './globalSetup' 10 + import type { WorkspaceSpec as DeprecatedWorkspaceSpec } from './pool' 11 + import type { BrowserServer } from './types/browser' 12 + import type { 13 + ResolvedConfig, 14 + SerializedConfig, 15 + UserConfig, 16 + UserWorkspaceConfig, 17 + } from './types/config' 1 18 import { promises as fs } from 'node:fs' 2 - import { tmpdir } from 'node:os' 3 19 import { rm } from 'node:fs/promises' 20 + import { tmpdir } from 'node:os' 21 + import { deepMerge, nanoid } from '@vitest/utils' 22 + import fg from 'fast-glob' 4 23 import mm from 'micromatch' 5 24 import { 6 25 dirname, ··· 10 29 resolve, 11 30 toNamespacedPath, 12 31 } from 'pathe' 13 - import type { 14 - TransformResult, 15 - ViteDevServer, 16 - InlineConfig as ViteInlineConfig, 17 - } from 'vite' 18 32 import { ViteNodeRunner } from 'vite-node/client' 19 33 import { ViteNodeServer } from 'vite-node/server' 20 - import fg from 'fast-glob' 21 - import { deepMerge, nanoid } from '@vitest/utils' 22 - import type { Typechecker } from '../typecheck/typechecker' 23 34 import { setup } from '../api/setup' 24 - import type { ProvidedContext } from '../types/general' 25 - import type { 26 - ResolvedConfig, 27 - SerializedConfig, 28 - UserConfig, 29 - UserWorkspaceConfig, 30 - } from './types/config' 31 - import type { BrowserServer } from './types/browser' 32 35 import { isBrowserEnabled, resolveConfig } from './config/resolveConfig' 33 - import { WorkspaceVitestPlugin } from './plugins/workspace' 34 - import { createViteServer } from './vite' 35 - import type { GlobalSetupFile } from './globalSetup' 36 - import { loadGlobalSetupFiles } from './globalSetup' 37 - import { MocksPlugins } from './plugins/mocks' 38 - import { CoverageTransform } from './plugins/coverageTransform' 39 36 import { serializeConfig } from './config/serializeConfig' 40 - import type { Vitest } from './core' 37 + import { loadGlobalSetupFiles } from './globalSetup' 38 + import { CoverageTransform } from './plugins/coverageTransform' 39 + import { MocksPlugins } from './plugins/mocks' 40 + import { WorkspaceVitestPlugin } from './plugins/workspace' 41 41 import { TestProject } from './reported-workspace-project' 42 42 import { TestSpecification } from './spec' 43 - import type { WorkspaceSpec as DeprecatedWorkspaceSpec } from './pool' 43 + import { createViteServer } from './vite' 44 44 45 45 interface InitializeProjectOptions extends UserWorkspaceConfig { 46 46 workspaceConfigPath: string
+8 -8
packages/vitest/src/public/browser.ts
··· 1 - export { startTests, collectTests, processError } from '@vitest/runner' 2 1 export { 3 - setupCommonEnv, 4 - loadDiffConfig, 5 - loadSnapshotSerializers, 6 - } from '../runtime/setup-common' 7 - export { 8 - takeCoverageInsideWorker, 9 - stopCoverageInsideWorker, 10 2 getCoverageProvider, 11 3 startCoverageInsideWorker, 4 + stopCoverageInsideWorker, 5 + takeCoverageInsideWorker, 12 6 } from '../integrations/coverage' 13 7 export * as SpyModule from '../integrations/spy' 8 + export { 9 + loadDiffConfig, 10 + loadSnapshotSerializers, 11 + setupCommonEnv, 12 + } from '../runtime/setup-common' 13 + export { collectTests, processError, startTests } from '@vitest/runner'
+7 -7
packages/vitest/src/public/config.ts
··· 1 + import type { ConfigEnv, UserConfig as ViteUserConfig } from 'vite' 2 + 3 + import type { UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../node/types/config' 1 4 import '../node/types/vite' 2 5 3 - import type { ConfigEnv, UserConfig as ViteUserConfig } from 'vite' 4 - import type { UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../node/types/config' 5 - 6 + export { extraInlineDeps } from '../constants' 6 7 // will import vitest declare test in module 'vite' 7 8 export { 8 - defaultBrowserPort, 9 9 configDefaults, 10 - defaultInclude, 11 - defaultExclude, 12 10 coverageConfigDefaults, 11 + defaultBrowserPort, 12 + defaultExclude, 13 + defaultInclude, 13 14 } from '../defaults' 14 15 export { mergeConfig } from 'vite' 15 - export { extraInlineDeps } from '../constants' 16 16 export type { Plugin } from 'vite' 17 17 18 18 export type { ConfigEnv, ViteUserConfig }
+1 -1
packages/vitest/src/public/environments.ts
··· 1 1 export { environments as builtinEnvironments } from '../integrations/env/index' 2 2 export { populateGlobal } from '../integrations/env/utils' 3 3 export type { 4 + Environment, 4 5 EnvironmentReturn, 5 6 VmEnvironmentReturn, 6 - Environment, 7 7 } from '../types/environment'
+175 -175
packages/vitest/src/public/index.ts
··· 1 - // TODO: deprecate <reference types="vitest" /> in favor of `<reference types="vitest/config" />` 2 - import '../node/types/vite' 3 - import '../types/global' 4 - 5 1 import type { 6 2 Custom as Custom_, 7 3 DoneCallback as DoneCallback_, 8 4 File as File_, 9 5 RuntimeContext as RuntimeContext_, 10 - SuiteHooks as SuiteHooks_, 11 6 Suite as Suite_, 12 - TaskBase as TaskBase_, 13 - TaskResultPack as TaskResultPack_, 14 - TaskResult as TaskResult_, 7 + SuiteHooks as SuiteHooks_, 15 8 Task as Task_, 9 + TaskBase as TaskBase_, 10 + TaskResult as TaskResult_, 11 + TaskResultPack as TaskResultPack_, 16 12 Test as Test_, 17 13 } from '@vitest/runner' 18 - import type { 19 - CollectLineNumbers as CollectLineNumbers_, 20 - CollectLines as CollectLines_, 21 - Context as Context_, 22 - RawErrsMap as RawErrsMap_, 23 - RootAndTarget as RootAndTarget_, 24 - TscErrorInfo as TscErrorInfo_, 25 - } from '../typecheck/types' 26 - 27 - import type { 28 - WorkerRPC as WorkerRPC_, 29 - } from '../types/worker' 30 - 31 - import type { 32 - ArgumentsType as ArgumentsType_, 33 - Arrayable as Arrayable_, 34 - Awaitable as Awaitable_, 35 - Constructable as Constructable_, 36 - MutableArray as MutableArray_, 37 - Nullable as Nullable_, 38 - OnServerRestartHandler as OnServerRestartHandler_, 39 - } from '../types/general' 40 - 41 - import type { 42 - EnvironmentReturn as EnvironmentReturn_, 43 - Environment as Environment_, 44 - ResolvedTestEnvironment as ResolvedTestEnvironment_, 45 - VmEnvironmentReturn as VmEnvironmentReturn_, 46 - } from '../types/environment' 47 - 48 - import type { 49 - BaseCoverageOptions as BaseCoverageOptions_, 50 - CoverageIstanbulOptions as CoverageIstanbulOptions_, 51 - CoverageOptions as CoverageOptions_, 52 - CoverageProviderModule as CoverageProviderModule_, 53 - CoverageProviderName, 54 - CoverageProvider as CoverageProvider_, 55 - CoverageReporter as CoverageReporter_, 56 - CoverageV8Options as CoverageV8Options_, 57 - CustomProviderOptions as CustomProviderOptions_, 58 - ReportContext as ReportContext_, 59 - ResolvedCoverageOptions as ResolvedCoverageOptions_, 60 - } from '../node/types/coverage' 61 - 62 - import type { 63 - /** @deprecated import from `vitest/node` instead */ 64 - Reporter as Reporter_, 65 - } from '../node/types/reporter' 66 14 import type { 67 15 /** @deprecated import from `vitest/node` instead */ 68 16 Vitest as Vitest_, 69 17 } from '../node/core' 18 + 19 + import type { 20 + BenchmarkUserOptions as BenchmarkUserOptions_, 21 + } from '../node/types/benchmark' 70 22 import type { 71 23 ApiConfig as ApiConfig_, 72 24 BrowserConfigOptions as BrowserConfigOptions_, ··· 78 30 HappyDOMOptions as HappyDOMOptions_, 79 31 InlineConfig as InlineConfig_, 80 32 JSDOMOptions as JSDOMOptions_, 81 - PoolOptions as PoolOptions_, 82 33 Pool as Pool_, 34 + PoolOptions as PoolOptions_, 83 35 ProjectConfig as ProjectConfig_, 84 36 ResolvedConfig as ResolvedConfig_, 85 37 SequenceHooks as SequenceHooks_, ··· 91 43 VitestEnvironment as VitestEnvironment_, 92 44 VitestRunMode as VitestRunMode_, 93 45 } from '../node/types/config' 94 - import type { 95 - BenchmarkUserOptions as BenchmarkUserOptions_, 96 - } from '../node/types/benchmark' 97 46 98 - import type { SerializedTestSpecification } from '../runtime/types/utils' 47 + import type { 48 + BaseCoverageOptions as BaseCoverageOptions_, 49 + CoverageIstanbulOptions as CoverageIstanbulOptions_, 50 + CoverageOptions as CoverageOptions_, 51 + CoverageProvider as CoverageProvider_, 52 + CoverageProviderModule as CoverageProviderModule_, 53 + CoverageProviderName, 54 + CoverageReporter as CoverageReporter_, 55 + CoverageV8Options as CoverageV8Options_, 56 + CustomProviderOptions as CustomProviderOptions_, 57 + ReportContext as ReportContext_, 58 + ResolvedCoverageOptions as ResolvedCoverageOptions_, 59 + } from '../node/types/coverage' 60 + 61 + import type { 62 + /** @deprecated import from `vitest/node` instead */ 63 + Reporter as Reporter_, 64 + } from '../node/types/reporter' 65 + 99 66 import type { 100 67 WorkerContext as WorkerContext_, 101 68 } from '../node/types/worker' 102 69 103 - export { 104 - suite, 105 - test, 106 - describe, 107 - it, 108 - beforeAll, 109 - beforeEach, 110 - afterAll, 111 - afterEach, 112 - onTestFailed, 113 - onTestFinished, 114 - } from '@vitest/runner' 115 - export { bench } from '../runtime/benchmark' 116 - export { expectTypeOf } from '../typecheck/expectTypeOf' 117 - export { assertType } from '../typecheck/assertType' 70 + import type { SerializedTestSpecification } from '../runtime/types/utils' 118 71 119 - export { runOnce, isFirstRun } from '../integrations/run-once' 120 - export { createExpect, assert, should, chai, expect } from '../integrations/chai' 121 - export { vi, vitest } from '../integrations/vi' 122 - export { getRunningMode, isWatchMode } from '../integrations/utils' 72 + import type { 73 + CollectLineNumbers as CollectLineNumbers_, 74 + CollectLines as CollectLines_, 75 + Context as Context_, 76 + RawErrsMap as RawErrsMap_, 77 + RootAndTarget as RootAndTarget_, 78 + TscErrorInfo as TscErrorInfo_, 79 + } from '../typecheck/types' 80 + import type { 81 + Environment as Environment_, 82 + EnvironmentReturn as EnvironmentReturn_, 83 + ResolvedTestEnvironment as ResolvedTestEnvironment_, 84 + VmEnvironmentReturn as VmEnvironmentReturn_, 85 + } from '../types/environment' 86 + import type { 87 + ArgumentsType as ArgumentsType_, 88 + Arrayable as Arrayable_, 89 + Awaitable as Awaitable_, 90 + Constructable as Constructable_, 91 + MutableArray as MutableArray_, 92 + Nullable as Nullable_, 93 + OnServerRestartHandler as OnServerRestartHandler_, 94 + } from '../types/general' 95 + import type { 96 + WorkerRPC as WorkerRPC_, 97 + } from '../types/worker' 98 + 99 + // TODO: deprecate <reference types="vitest" /> in favor of `<reference types="vitest/config" />` 100 + import '../node/types/vite' 101 + import '../types/global' 102 + 103 + export type { 104 + TransformResultWithSource, 105 + WebSocketEvents, 106 + WebSocketHandlers, 107 + WebSocketRPC, 108 + } from '../api/types' 109 + export { assert, chai, createExpect, expect, should } from '../integrations/chai' 123 110 export { inject } from '../integrations/inject' 111 + export { isFirstRun, runOnce } from '../integrations/run-once' 124 112 113 + export type { 114 + Mock, 115 + MockContext, 116 + Mocked, 117 + MockedClass, 118 + MockedFunction, 119 + MockedObject, 120 + MockInstance, 121 + } from '../integrations/spy' 122 + export { getRunningMode, isWatchMode } from '../integrations/utils' 123 + export { vi, vitest } from '../integrations/vi' 125 124 export type { VitestUtils } from '../integrations/vi' 125 + export { bench } from '../runtime/benchmark' 126 126 127 - export type { ExpectTypeOf } from '../typecheck/expectTypeOf' 128 - export type { AssertType } from '../typecheck/assertType' 127 + export type { 128 + RuntimeConfig, 129 + SerializedConfig, 130 + SerializedCoverageConfig, 131 + } from '../runtime/config' 132 + 133 + export type { 134 + BenchFactory, 135 + BenchFunction, 136 + Benchmark, 137 + BenchmarkAPI, 138 + BenchmarkResult, 139 + BenchOptions, 140 + BenchTask, 141 + BenchTaskResult, 142 + } from '../runtime/types/benchmark' 143 + export { assertType } from '../typecheck/assertType' 129 144 130 145 /** @deprecated import `TypeCheckRawErrorsMap` from `vitest/node` instead */ 131 146 export type RawErrsMap = RawErrsMap_ ··· 165 180 /** @deprecated internal type, don't use it */ 166 181 export type SuiteHooks = SuiteHooks_ 167 182 168 - export type { 169 - RunMode, 170 - TaskState, 171 - TaskBase as RunnerTaskBase, 172 - TaskResult as RunnerTaskResult, 173 - TaskResultPack as RunnerTaskResultPack, 174 - Suite as RunnerTestSuite, 175 - File as RunnerTestFile, 176 - Test as RunnerTestCase, 177 - Task as RunnerTask, 178 - Custom as RunnerCustomCase, 179 - TestFunction, 180 - TestOptions, 181 - TestAPI, 182 - SuiteAPI, 183 - HookListener, 184 - HookCleanupCallback, 185 - SuiteCollector, 186 - SuiteFactory, 187 - TestContext, 188 - TaskContext, 189 - ExtendedContext, 190 - TaskCustomOptions, 191 - OnTestFailedHandler, 192 - OnTestFinishedHandler, 193 - TaskMeta, 194 - } from '@vitest/runner' 195 - export type { 196 - RuntimeRPC, 197 - RunnerRPC, 198 - } from '../types/rpc' 199 - export type { 200 - SnapshotData, 201 - SnapshotUpdateState, 202 - SnapshotStateOptions, 203 - SnapshotMatchOptions, 204 - SnapshotResult, 205 - UncheckedSnapshot, 206 - SnapshotSummary, 207 - SnapshotSerializer, 208 - } from '@vitest/snapshot' 183 + export type { AssertType } from '../typecheck/assertType' 184 + export { expectTypeOf } from '../typecheck/expectTypeOf' 185 + export type { ExpectTypeOf } from '../typecheck/expectTypeOf' 209 186 210 187 /** @deprecated import from `vitest/node` instead */ 211 188 export type WorkerContext = WorkerContext_ ··· 213 190 export type WorkerRPC = WorkerRPC_ 214 191 215 192 export type { 216 - ResolveIdFunction, 217 - WorkerGlobalState, 218 - ContextTestEnvironment, 219 - ContextRPC, 220 - } from '../types/worker' 193 + AfterSuiteRunMeta, 194 + ErrorWithDiff, 195 + ModuleCache, 196 + ModuleGraphData, 197 + ParsedStack, 198 + ProvidedContext, 199 + UserConsoleLog, 200 + } from '../types/general' 221 201 222 202 /** @deprecated do not use, internal helper */ 223 203 export type Awaitable<T> = Awaitable_<T> ··· 235 215 export type OnServerRestartHandler = OnServerRestartHandler_ 236 216 237 217 export type { 238 - ErrorWithDiff, 239 - ParsedStack, 240 - ModuleCache, 241 - UserConsoleLog, 242 - ModuleGraphData, 243 - ProvidedContext, 244 - AfterSuiteRunMeta, 245 - } from '../types/general' 218 + RunnerRPC, 219 + RuntimeRPC, 220 + } from '../types/rpc' 246 221 247 - export type { TestError, SerializedError } from '@vitest/utils' 222 + export type { BrowserUI } from '../types/ui' 248 223 249 224 /** @deprecated import from `vitest/environments` instead */ 250 225 export type EnvironmentReturn = EnvironmentReturn_ ··· 276 251 /** @deprecated import from `vitest/node` instead */ 277 252 export type CustomProviderOptions = CustomProviderOptions_ 278 253 279 - export type { CancelReason } from '@vitest/runner' 280 - export type { DiffOptions } from '@vitest/utils/diff' 281 254 export type { 282 - MockedFunction, 283 - MockedObject, 284 - MockInstance, 285 - Mock, 286 - MockContext, 287 - Mocked, 288 - MockedClass, 289 - } from '../integrations/spy' 290 - export type { BrowserUI } from '../types/ui' 255 + ContextRPC, 256 + ContextTestEnvironment, 257 + ResolveIdFunction, 258 + WorkerGlobalState, 259 + } from '../types/worker' 260 + export type { 261 + Assertion, 262 + AsymmetricMatchersContaining, 263 + ExpectPollOptions, 264 + ExpectStatic, 265 + JestAssertion, 266 + } from '@vitest/expect' 267 + export { 268 + afterAll, 269 + afterEach, 270 + beforeAll, 271 + beforeEach, 272 + describe, 273 + it, 274 + onTestFailed, 275 + onTestFinished, 276 + suite, 277 + test, 278 + } from '@vitest/runner' 279 + export type { 280 + Custom as RunnerCustomCase, 281 + ExtendedContext, 282 + File as RunnerTestFile, 283 + HookCleanupCallback, 284 + HookListener, 285 + OnTestFailedHandler, 286 + OnTestFinishedHandler, 287 + RunMode, 288 + Suite as RunnerTestSuite, 289 + SuiteAPI, 290 + SuiteCollector, 291 + SuiteFactory, 292 + Task as RunnerTask, 293 + TaskBase as RunnerTaskBase, 294 + TaskContext, 295 + TaskCustomOptions, 296 + TaskMeta, 297 + TaskResult as RunnerTaskResult, 298 + TaskResultPack as RunnerTaskResultPack, 299 + TaskState, 300 + Test as RunnerTestCase, 301 + TestAPI, 302 + TestContext, 303 + TestFunction, 304 + TestOptions, 305 + } from '@vitest/runner' 291 306 292 307 /** @deprecated import from `vitest/reporter` instead */ 293 308 export type Reporter = Reporter_ 294 309 /** @deprecated import from `vitest/node` instead */ 295 310 export type Vitest = Vitest_ 296 311 297 - export type { 298 - ExpectStatic, 299 - AsymmetricMatchersContaining, 300 - JestAssertion, 301 - Assertion, 302 - ExpectPollOptions, 303 - } from '@vitest/expect' 312 + export type { CancelReason } from '@vitest/runner' 304 313 305 314 export type { 306 - SerializedConfig, 307 - RuntimeConfig, 308 - SerializedCoverageConfig, 309 - } from '../runtime/config' 315 + SnapshotData, 316 + SnapshotMatchOptions, 317 + SnapshotResult, 318 + SnapshotSerializer, 319 + SnapshotStateOptions, 320 + SnapshotSummary, 321 + SnapshotUpdateState, 322 + UncheckedSnapshot, 323 + } from '@vitest/snapshot' 310 324 311 325 /** @deprecated import from `vitest/node` instead */ 312 326 export type BrowserScript = BrowserScript_ ··· 353 367 /** @deprecated import from `vitest/node` instead */ 354 368 export type UserWorkspaceConfig = UserWorkspaceConfig_ 355 369 356 - export type { 357 - Benchmark, 358 - BenchmarkResult, 359 - BenchFunction, 360 - BenchmarkAPI, 361 - BenchTaskResult, 362 - BenchOptions, 363 - BenchFactory, 364 - BenchTask, 365 - } from '../runtime/types/benchmark' 370 + export type { SerializedError, TestError } from '@vitest/utils' 366 371 367 372 /** @deprecated use `SerializedTestSpecification` instead */ 368 373 export type SerializableSpec = SerializedTestSpecification ··· 371 376 /** @deprecated import from `vitest/node` instead */ 372 377 export type BenchmarkUserOptions = BenchmarkUserOptions_ 373 378 374 - export type { 375 - TransformResultWithSource, 376 - WebSocketHandlers, 377 - WebSocketEvents, 378 - WebSocketRPC, 379 - } from '../api/types' 379 + export type { DiffOptions } from '@vitest/utils/diff'
+94 -94
packages/vitest/src/public/node.ts
··· 1 + import type { ModuleDiagnostic as _FileDiagnostic } from '../node/reporters/reported-tasks' 1 2 import { createServer as _createServer } from 'vite' 2 3 import { TestModule as _TestFile } from '../node/reporters/reported-tasks' 3 - import type { ModuleDiagnostic as _FileDiagnostic } from '../node/reporters/reported-tasks' 4 4 5 - export type { Vitest } from '../node/core' 6 - export type { WorkspaceProject } from '../node/workspace' 7 - export { createVitest } from '../node/create' 8 - export { VitestPlugin } from '../node/plugins' 9 - export { startVitest } from '../node/cli/cli-api' 10 5 export { parseCLI } from '../node/cli/cac' 11 - export { registerConsoleShortcuts } from '../node/stdin' 12 - export type { GlobalSetupContext } from '../node/globalSetup' 13 - export type { WorkspaceSpec, ProcessPool } from '../node/pool' 14 - export { createMethodsRPC } from '../node/pools/rpc' 15 - export { getFilePoolName } from '../node/pool' 16 - export { VitestPackageInstaller } from '../node/packageInstaller' 17 - export { createDebugger } from '../utils/debugger' 18 - export { resolveFsAllow } from '../node/plugins/utils' 6 + export { startVitest } from '../node/cli/cli-api' 19 7 export { resolveApiServerConfig, resolveConfig } from '../node/config/resolveConfig' 20 - export { TestSpecification } from '../node/spec' 21 - export { createViteLogger } from '../node/viteLogger' 8 + export type { Vitest } from '../node/core' 9 + export { createVitest } from '../node/create' 10 + export { FilesNotFoundError as TestsNotFoundError, GitNotFoundError } from '../node/errors' 11 + export type { GlobalSetupContext } from '../node/globalSetup' 12 + export { VitestPackageInstaller } from '../node/packageInstaller' 13 + export { VitestPlugin } from '../node/plugins' 14 + export { resolveFsAllow } from '../node/plugins/utils' 15 + export type { ProcessPool, WorkspaceSpec } from '../node/pool' 16 + export { getFilePoolName } from '../node/pool' 17 + export { createMethodsRPC } from '../node/pools/rpc' 18 + export { TestProject } from '../node/reported-workspace-project' 19 + export type { SerializedTestProject } from '../node/reported-workspace-project' 20 + export type { HTMLOptions } from '../node/reporters/html' 21 + export type { JsonOptions } from '../node/reporters/json' 22 22 23 - export { GitNotFoundError, FilesNotFoundError as TestsNotFoundError } from '../node/errors' 23 + export type { JUnitOptions } from '../node/reporters/junit' 24 24 25 - export { distDir, rootDir } from '../paths' 25 + export { TestCase, TestModule, TestSuite } from '../node/reporters/reported-tasks' 26 + 27 + export type { 28 + ModuleDiagnostic, 29 + 30 + TaskOptions, 31 + TestCollection, 32 + TestDiagnostic, 33 + TestResult, 34 + TestResultFailed, 35 + TestResultPassed, 36 + TestResultSkipped, 37 + } from '../node/reporters/reported-tasks' 38 + export { BaseSequencer } from '../node/sequencers/BaseSequencer' 26 39 27 40 export type { 28 41 TestSequencer, 29 42 TestSequencerConstructor, 30 43 } from '../node/sequencers/types' 31 - export { BaseSequencer } from '../node/sequencers/BaseSequencer' 44 + export { TestSpecification } from '../node/spec' 45 + export { registerConsoleShortcuts } from '../node/stdin' 46 + export type { BenchmarkUserOptions } from '../node/types/benchmark' 32 47 33 48 export type { 34 - BrowserProviderInitializationOptions, 35 - BrowserProvider, 36 - CDPSession, 37 - BrowserProviderModule, 38 - ResolvedBrowserOptions, 39 - BrowserProviderOptions, 40 49 BrowserBuiltinProvider, 41 - BrowserScript, 42 50 BrowserCommand, 43 51 BrowserCommandContext, 52 + BrowserConfigOptions, 53 + BrowserOrchestrator, 54 + BrowserProvider, 55 + BrowserProviderInitializationOptions, 56 + BrowserProviderModule, 57 + BrowserProviderOptions, 58 + BrowserScript, 44 59 BrowserServer, 45 60 BrowserServerState, 46 61 BrowserServerStateContext, 47 - BrowserOrchestrator, 48 - BrowserConfigOptions, 62 + CDPSession, 63 + ResolvedBrowserOptions, 49 64 } from '../node/types/browser' 50 - export type { JsonOptions } from '../node/reporters/json' 51 - export type { JUnitOptions } from '../node/reporters/junit' 52 - export type { HTMLOptions } from '../node/reporters/html' 53 - 54 - export { 55 - isFileServingAllowed, 56 - parseAst, 57 - parseAstAsync, 58 - } from 'vite' 59 65 /** @deprecated use `createViteServer` instead */ 60 66 export const createServer = _createServer 61 67 export const createViteServer = _createServer 62 - export type * as Vite from 'vite' 68 + export type { 69 + ApiConfig, 70 + BuiltinEnvironment, 71 + CSSModuleScopeStrategy, 72 + DepsOptimizationOptions, 73 + EnvironmentOptions, 74 + HappyDOMOptions, 75 + InlineConfig, 76 + JSDOMOptions, 77 + Pool, 78 + PoolOptions, 79 + ProjectConfig, 80 + ResolvedConfig, 81 + ResolvedProjectConfig, 82 + RuntimeConfig, 83 + SequenceHooks, 84 + SequenceSetupFiles, 85 + TransformModePatterns, 86 + TypecheckConfig, 87 + UserConfig, 88 + UserWorkspaceConfig, 89 + VitestEnvironment, 90 + VitestRunMode, 91 + } from '../node/types/config' 63 92 64 - export { TestCase, TestModule, TestSuite } from '../node/reporters/reported-tasks' 93 + export type { 94 + BaseCoverageOptions, 95 + CoverageIstanbulOptions, 96 + CoverageOptions, 97 + CoverageProvider, 98 + CoverageProviderModule, 99 + CoverageReporter, 100 + CoverageV8Options, 101 + CustomProviderOptions, 102 + ReportContext, 103 + ResolvedCoverageOptions, 104 + } from '../node/types/coverage' 65 105 /** 66 106 * @deprecated Use `TestModule` instead 67 107 */ 68 108 export const TestFile = _TestFile 69 - export { TestProject } from '../node/reported-workspace-project' 70 - export type { SerializedTestProject } from '../node/reported-workspace-project' 71 - export type { 72 - TestCollection, 73 - 74 - TaskOptions, 75 - TestDiagnostic, 76 - ModuleDiagnostic, 77 - TestResult, 78 - TestResultPassed, 79 - TestResultFailed, 80 - TestResultSkipped, 81 - } from '../node/reporters/reported-tasks' 109 + export type { WorkerContext } from '../node/types/worker' 110 + export { createViteLogger } from '../node/viteLogger' 111 + export type { WorkspaceProject } from '../node/workspace' 82 112 83 113 /** 84 114 * @deprecated Use `ModuleDiagnostic` instead 85 115 */ 86 116 export type FileDiagnostic = _FileDiagnostic 87 117 88 - export type { 89 - SequenceHooks, 90 - SequenceSetupFiles, 91 - BuiltinEnvironment, 92 - VitestEnvironment, 93 - Pool, 94 - PoolOptions, 95 - CSSModuleScopeStrategy, 96 - ApiConfig, 97 - JSDOMOptions, 98 - HappyDOMOptions, 99 - EnvironmentOptions, 100 - VitestRunMode, 101 - DepsOptimizationOptions, 102 - TransformModePatterns, 103 - InlineConfig, 104 - TypecheckConfig, 105 - UserConfig, 106 - ResolvedConfig, 107 - ProjectConfig, 108 - ResolvedProjectConfig, 109 - UserWorkspaceConfig, 110 - RuntimeConfig, 111 - } from '../node/types/config' 112 - 113 - export type { BenchmarkUserOptions } from '../node/types/benchmark' 118 + export { distDir, rootDir } from '../paths' 114 119 115 120 export type { 116 - RawErrsMap as TypeCheckRawErrorsMap, 117 - TscErrorInfo as TypeCheckErrorInfo, 118 121 CollectLineNumbers as TypeCheckCollectLineNumbers, 119 122 CollectLines as TypeCheckCollectLines, 120 - RootAndTarget as TypeCheckRootAndTarget, 121 123 Context as TypeCheckContext, 124 + RawErrsMap as TypeCheckRawErrorsMap, 125 + RootAndTarget as TypeCheckRootAndTarget, 126 + TscErrorInfo as TypeCheckErrorInfo, 122 127 } from '../typecheck/types' 123 128 124 129 export type { OnServerRestartHandler } from '../types/general' 125 130 126 - export type { 127 - CoverageProvider, 128 - ReportContext, 129 - CoverageProviderModule, 130 - CoverageReporter, 131 - CoverageOptions, 132 - ResolvedCoverageOptions, 133 - BaseCoverageOptions, 134 - CoverageIstanbulOptions, 135 - CoverageV8Options, 136 - CustomProviderOptions, 137 - } from '../node/types/coverage' 131 + export { createDebugger } from '../utils/debugger' 138 132 139 - export type { WorkerContext } from '../node/types/worker' 133 + export { 134 + isFileServingAllowed, 135 + parseAst, 136 + parseAstAsync, 137 + } from 'vite' 138 + 139 + export type * as Vite from 'vite'
+1 -1
packages/vitest/src/public/runners.ts
··· 1 - export { VitestTestRunner } from '../runtime/runners/test' 2 1 export { NodeBenchmarkRunner } from '../runtime/runners/benchmark' 2 + export { VitestTestRunner } from '../runtime/runners/test'
+1 -1
packages/vitest/src/public/snapshot.ts
··· 1 - export type { SnapshotEnvironment } from '@vitest/snapshot/environment' 2 1 export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from '../integrations/snapshot/environments/node' 2 + export type { SnapshotEnvironment } from '@vitest/snapshot/environment'
+3 -3
packages/vitest/src/public/suite.ts
··· 1 + export { getBenchFn, getBenchOptions } from '../runtime/benchmark' 1 2 export { 3 + createTaskCollector, 2 4 getCurrentSuite, 3 5 getCurrentTest, 4 - createTaskCollector, 5 6 getFn, 6 - setFn, 7 7 getHooks, 8 + setFn, 8 9 setHooks, 9 10 } from '@vitest/runner' 10 11 export { createChainable } from '@vitest/runner/utils' 11 - export { getBenchFn, getBenchOptions } from '../runtime/benchmark'
+4 -4
packages/vitest/src/public/workers.ts
··· 1 + export { provideWorkerState } from '../runtime/utils' 2 + export { collect as collectVitestWorkerTests, run as runVitestWorker } from '../runtime/worker' 3 + export { runBaseTests } from '../runtime/workers/base' 4 + export type { VitestWorker, WorkerRpcOptions } from '../runtime/workers/types' 1 5 export { 2 6 createForksRpcOptions, 3 7 createThreadsRpcOptions, 4 8 unwrapSerializableConfig, 5 9 } from '../runtime/workers/utils' 6 - export { provideWorkerState } from '../runtime/utils' 7 - export { run as runVitestWorker, collect as collectVitestWorkerTests } from '../runtime/worker' 8 10 export { runVmTests } from '../runtime/workers/vm' 9 - export { runBaseTests } from '../runtime/workers/base' 10 - export type { WorkerRpcOptions, VitestWorker } from '../runtime/workers/types'
+1 -1
packages/vitest/src/runtime/benchmark.ts
··· 1 1 import type { Custom } from '@vitest/runner' 2 + import type { BenchFunction, BenchmarkAPI, BenchOptions } from './types/benchmark' 2 3 import { getCurrentSuite } from '@vitest/runner' 3 4 import { createChainable } from '@vitest/runner/utils' 4 5 import { noop } from '@vitest/utils' 5 - import type { BenchFunction, BenchOptions, BenchmarkAPI } from './types/benchmark' 6 6 import { getWorkerState } from './utils' 7 7 8 8 const benchFns = new WeakMap<Custom, BenchFunction>()
+2 -2
packages/vitest/src/runtime/console.ts
··· 1 - import { Writable } from 'node:stream' 1 + import type { WorkerGlobalState } from '../types/worker' 2 2 import { Console } from 'node:console' 3 3 import { relative } from 'node:path' 4 + import { Writable } from 'node:stream' 4 5 import { getSafeTimers } from '@vitest/utils' 5 6 import c from 'tinyrainbow' 6 7 import { RealDate } from '../integrations/mock/date' 7 - import type { WorkerGlobalState } from '../types/worker' 8 8 import { getWorkerState } from './utils' 9 9 10 10 export const UNKNOWN_TEST_ID = '__vitest__unknown_test__'
+8 -8
packages/vitest/src/runtime/execute.ts
··· 1 - import vm from 'node:vm' 2 - import { pathToFileURL } from 'node:url' 3 - import fs from 'node:fs' 1 + import type { ViteNodeRunnerOptions } from 'vite-node' 4 2 import type { ModuleCacheMap } from 'vite-node/client' 3 + import type { WorkerGlobalState } from '../types/worker' 4 + import type { ExternalModulesExecutor } from './external-executor' 5 + import fs from 'node:fs' 6 + import { pathToFileURL } from 'node:url' 7 + import vm from 'node:vm' 8 + import { processError } from '@vitest/utils/error' 9 + import { normalize, relative } from 'pathe' 5 10 import { DEFAULT_REQUEST_STUBS, ViteNodeRunner } from 'vite-node/client' 6 11 import { 7 12 isInternalRequest, ··· 9 14 isPrimitive, 10 15 toFilePath, 11 16 } from 'vite-node/utils' 12 - import type { ViteNodeRunnerOptions } from 'vite-node' 13 - import { normalize, relative } from 'pathe' 14 - import { processError } from '@vitest/utils/error' 15 17 import { distDir } from '../paths' 16 - import type { WorkerGlobalState } from '../types/worker' 17 18 import { VitestMocker } from './mocker' 18 - import type { ExternalModulesExecutor } from './external-executor' 19 19 20 20 const { readFileSync } = fs 21 21
+6 -6
packages/vitest/src/runtime/external-executor.ts
··· 1 - import vm from 'node:vm' 2 - import { fileURLToPath, pathToFileURL } from 'node:url' 3 - import { dirname } from 'node:path' 1 + import type { RuntimeRPC } from '../types/rpc' 2 + import type { FileMap } from './vm/file-map' 3 + import type { VMModule, VMSyntheticModule } from './vm/types' 4 4 import fs from 'node:fs' 5 + import { dirname } from 'node:path' 6 + import { fileURLToPath, pathToFileURL } from 'node:url' 7 + import vm from 'node:vm' 5 8 import { extname, join, normalize } from 'pathe' 6 9 import { getCachedData, isNodeBuiltin, setCacheData } from 'vite-node/utils' 7 - import type { RuntimeRPC } from '../types/rpc' 8 - import type { VMModule, VMSyntheticModule } from './vm/types' 9 10 import { CommonjsExecutor } from './vm/commonjs-executor' 10 - import type { FileMap } from './vm/file-map' 11 11 import { EsmExecutor } from './vm/esm-executor' 12 12 import { interopCommonJsModule } from './vm/utils' 13 13 import { ViteExecutor } from './vm/vite-executor'
+2 -2
packages/vitest/src/runtime/inspector.ts
··· 1 - import { createRequire } from 'node:module' 2 - import { pathToFileURL } from 'node:url' 3 1 import type { ContextRPC } from '../types/worker' 4 2 import type { SerializedConfig } from './config' 3 + import { createRequire } from 'node:module' 4 + import { pathToFileURL } from 'node:url' 5 5 6 6 const __require = createRequire(import.meta.url) 7 7 let inspector: typeof import('node:inspector')
+6 -6
packages/vitest/src/runtime/mocker.ts
··· 1 - import vm from 'node:vm' 2 - import { isAbsolute, resolve } from 'pathe' 3 - import { highlight } from '@vitest/utils' 4 1 import type { ManualMockedModule, MockedModuleType } from '@vitest/mocker' 5 - import { AutomockedModule, MockerRegistry, RedirectedModule, mockObject } from '@vitest/mocker' 6 - import { findMockRedirect } from '@vitest/mocker/redirect' 7 - import { distDir } from '../paths' 8 2 import type { MockFactory, MockOptions, PendingSuiteMock } from '../types/mocker' 9 3 import type { VitestExecutor } from './execute' 4 + import vm from 'node:vm' 5 + import { AutomockedModule, MockerRegistry, mockObject, RedirectedModule } from '@vitest/mocker' 6 + import { findMockRedirect } from '@vitest/mocker/redirect' 7 + import { highlight } from '@vitest/utils' 8 + import { isAbsolute, resolve } from 'pathe' 9 + import { distDir } from '../paths' 10 10 11 11 const spyModulePath = resolve(distDir, 'spy.js') 12 12
+2 -2
packages/vitest/src/runtime/rpc.ts
··· 1 - import { getSafeTimers } from '@vitest/utils' 2 1 import type { CancelReason } from '@vitest/runner' 3 - import { createBirpc } from 'birpc' 4 2 import type { BirpcOptions, BirpcReturn } from 'birpc' 5 3 import type { RunnerRPC, RuntimeRPC } from '../types/rpc' 6 4 import type { WorkerRPC } from '../types/worker' 5 + import { getSafeTimers } from '@vitest/utils' 6 + import { createBirpc } from 'birpc' 7 7 import { getWorkerState } from './utils' 8 8 9 9 const { get } = Reflect
+7 -7
packages/vitest/src/runtime/runBaseTests.ts
··· 1 + import type { ResolvedTestEnvironment } from '../types/environment' 2 + import type { SerializedConfig } from './config' 3 + import type { VitestExecutor } from './execute' 1 4 import { performance } from 'node:perf_hooks' 2 5 import { collectTests, startTests } from '@vitest/runner' 3 - import { vi } from '../integrations/vi' 6 + import { setupChaiConfig } from '../integrations/chai/config' 4 7 import { 5 8 startCoverageInsideWorker, 6 9 stopCoverageInsideWorker, 7 10 } from '../integrations/coverage' 8 - import { setupChaiConfig } from '../integrations/chai/config' 9 - import type { ResolvedTestEnvironment } from '../types/environment' 10 - import type { SerializedConfig } from './config' 11 - import { setupGlobalEnv, withEnv } from './setup-node' 12 - import type { VitestExecutor } from './execute' 13 - import { resolveTestRunner } from './runners' 11 + import { vi } from '../integrations/vi' 14 12 import { closeInspector } from './inspector' 13 + import { resolveTestRunner } from './runners' 14 + import { setupGlobalEnv, withEnv } from './setup-node' 15 15 import { getWorkerState, resetModules } from './utils' 16 16 17 17 // browser shouldn't call this!
+8 -8
packages/vitest/src/runtime/runVmTests.ts
··· 1 + import type { SerializedConfig } from './config' 2 + import type { VitestExecutor } from './execute' 1 3 import { createRequire } from 'node:module' 2 - import util from 'node:util' 3 - import timers from 'node:timers' 4 4 import { performance } from 'node:perf_hooks' 5 + import timers from 'node:timers' 6 + import util from 'node:util' 5 7 import { collectTests, startTests } from '@vitest/runner' 6 - import { installSourcemapsSupport } from 'vite-node/source-map' 7 8 import { KNOWN_ASSET_TYPES } from 'vite-node/constants' 9 + import { installSourcemapsSupport } from 'vite-node/source-map' 8 10 import { setupChaiConfig } from '../integrations/chai/config' 9 11 import { 10 12 startCoverageInsideWorker, 11 13 stopCoverageInsideWorker, 12 14 } from '../integrations/coverage' 13 - import * as VitestIndex from '../public/index' 14 15 import { resolveSnapshotEnvironment } from '../integrations/snapshot/environments/resolveSnapshotEnvironment' 15 - import { getWorkerState } from './utils' 16 - import type { VitestExecutor } from './execute' 16 + import * as VitestIndex from '../public/index' 17 + import { closeInspector } from './inspector' 17 18 import { resolveTestRunner } from './runners' 18 19 import { setupCommonEnv } from './setup-common' 19 - import { closeInspector } from './inspector' 20 - import type { SerializedConfig } from './config' 20 + import { getWorkerState } from './utils' 21 21 22 22 export async function run( 23 23 method: 'run' | 'collect',
+5 -5
packages/vitest/src/runtime/setup-common.ts
··· 1 - import { setSafeTimers } from '@vitest/utils' 2 - import { addSerializer } from '@vitest/snapshot' 3 - import type { SnapshotSerializer } from '@vitest/snapshot' 4 1 import type { DiffOptions } from '@vitest/expect' 5 - import { resetRunOnceCounter } from '../integrations/run-once' 6 - import type { VitestExecutor } from './execute' 2 + import type { SnapshotSerializer } from '@vitest/snapshot' 7 3 import type { SerializedConfig } from './config' 4 + import type { VitestExecutor } from './execute' 5 + import { addSerializer } from '@vitest/snapshot' 6 + import { setSafeTimers } from '@vitest/utils' 7 + import { resetRunOnceCounter } from '../integrations/run-once' 8 8 9 9 let globalSetup = false 10 10 export async function setupCommonEnv(config: SerializedConfig) {
+8 -8
packages/vitest/src/runtime/setup-node.ts
··· 1 + import type { ResolvedTestEnvironment } from '../types/environment' 2 + import type { SerializedConfig } from './config' 3 + import type { VitestExecutor } from './execute' 1 4 import { createRequire } from 'node:module' 2 - import util from 'node:util' 3 5 import timers from 'node:timers' 4 - import { installSourcemapsSupport } from 'vite-node/source-map' 5 - import { KNOWN_ASSET_TYPES } from 'vite-node/constants' 6 + import util from 'node:util' 6 7 import { getSafeTimers } from '@vitest/utils' 7 - import * as VitestIndex from '../public/index' 8 + import { KNOWN_ASSET_TYPES } from 'vite-node/constants' 9 + import { installSourcemapsSupport } from 'vite-node/source-map' 8 10 import { expect } from '../integrations/chai' 9 11 import { resolveSnapshotEnvironment } from '../integrations/snapshot/environments/resolveSnapshotEnvironment' 10 - import type { ResolvedTestEnvironment } from '../types/environment' 11 - import { getWorkerState } from './utils' 12 + import * as VitestIndex from '../public/index' 12 13 import { setupCommonEnv } from './setup-common' 13 - import type { VitestExecutor } from './execute' 14 - import type { SerializedConfig } from './config' 14 + import { getWorkerState } from './utils' 15 15 16 16 // this should only be used in Node 17 17 let globalSetup = false
+1 -1
packages/vitest/src/runtime/utils.ts
··· 1 1 import type { ModuleCacheMap } from 'vite-node/client' 2 2 3 - import { getSafeTimers } from '@vitest/utils' 4 3 import type { WorkerGlobalState } from '../types/worker' 4 + import { getSafeTimers } from '@vitest/utils' 5 5 6 6 const NAME_WORKER_STATE = '__vitest_worker__' 7 7
+3 -3
packages/vitest/src/runtime/worker.ts
··· 1 + import type { ContextRPC, WorkerGlobalState } from '../types/worker' 2 + import type { VitestWorker } from './workers/types' 1 3 import { pathToFileURL } from 'node:url' 2 4 import { workerId as poolId } from 'tinypool' 3 5 import { ModuleCacheMap } from 'vite-node/client' 4 6 import { loadEnvironment } from '../integrations/env/loader' 5 - import type { ContextRPC, WorkerGlobalState } from '../types/worker' 6 - import { isChildProcess, setProcessTitle } from './utils' 7 7 import { setupInspect } from './inspector' 8 8 import { createRuntimeRpc, rpcDone } from './rpc' 9 - import type { VitestWorker } from './workers/types' 9 + import { isChildProcess, setProcessTitle } from './utils' 10 10 import { disposeInternalListeners } from './workers/utils' 11 11 12 12 if (isChildProcess()) {
+5 -5
packages/vitest/src/typecheck/collect.ts
··· 1 - import { relative } from 'pathe' 2 - import { parseAstAsync } from 'vite' 3 - import { ancestor as walkAst } from 'acorn-walk' 1 + import type { File, Suite, Test } from '@vitest/runner' 4 2 import type { RawSourceMap } from 'vite-node' 3 + import type { WorkspaceProject } from '../node/workspace' 5 4 import { 6 5 calculateSuiteHash, 7 6 generateHash, 8 7 interpretTaskModes, 9 8 someTasksAreOnly, 10 9 } from '@vitest/runner/utils' 11 - import type { File, Suite, Test } from '@vitest/runner' 12 - import type { WorkspaceProject } from '../node/workspace' 10 + import { ancestor as walkAst } from 'acorn-walk' 11 + import { relative } from 'pathe' 12 + import { parseAstAsync } from 'vite' 13 13 14 14 interface ParsedFile extends File { 15 15 start: number
+5 -5
packages/vitest/src/typecheck/parse.ts
··· 1 - import url from 'node:url' 2 - import os from 'node:os' 3 - import { writeFile } from 'node:fs/promises' 4 - import { basename, dirname, join, resolve } from 'pathe' 5 - import { getTsconfig as getTsconfigContent } from 'get-tsconfig' 6 1 import type { TypecheckConfig } from '../node/types/config' 7 2 import type { RawErrsMap, TscErrorInfo } from './types' 3 + import { writeFile } from 'node:fs/promises' 4 + import os from 'node:os' 5 + import url from 'node:url' 6 + import { getTsconfig as getTsconfigContent } from 'get-tsconfig' 7 + import { basename, dirname, join, resolve } from 'pathe' 8 8 9 9 const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) 10 10 const newLineRegExp = /\r?\n/
+12 -12
packages/vitest/src/typecheck/typechecker.ts
··· 1 - import { rm } from 'node:fs/promises' 2 - import { performance } from 'node:perf_hooks' 3 - import type { ChildProcess } from 'node:child_process' 4 - import { basename, extname, resolve } from 'pathe' 5 - import { TraceMap, generatedPositionFor } from '@vitest/utils/source-map' 6 1 import type { RawSourceMap } from '@ampproject/remapping' 7 - import type { ParsedStack } from '@vitest/utils' 8 2 import type { File, Task, TaskResultPack, TaskState } from '@vitest/runner' 9 - import { x } from 'tinyexec' 10 - import { getTasks } from '@vitest/runner/utils' 3 + import type { ParsedStack } from '@vitest/utils' 4 + import type { ChildProcess } from 'node:child_process' 5 + import type { Vitest } from '../node/core' 11 6 import type { WorkspaceProject } from '../node/workspace' 12 7 import type { Awaitable } from '../types/general' 13 - import type { Vitest } from '../node/core' 8 + import type { FileInformation } from './collect' 9 + import type { TscErrorInfo } from './types' 10 + import { rm } from 'node:fs/promises' 11 + import { performance } from 'node:perf_hooks' 12 + import { getTasks } from '@vitest/runner/utils' 13 + import { generatedPositionFor, TraceMap } from '@vitest/utils/source-map' 14 + import { basename, extname, resolve } from 'pathe' 15 + import { x } from 'tinyexec' 16 + import { collectTests } from './collect' 14 17 import { getRawErrsMapFromTsCompile, getTsconfig } from './parse' 15 18 import { createIndexMap } from './utils' 16 - import type { FileInformation } from './collect' 17 - import { collectTests } from './collect' 18 - import type { TscErrorInfo } from './types' 19 19 20 20 export class TypeCheckError extends Error { 21 21 name = 'TypeCheckError'
+1 -1
packages/vitest/src/types/global.ts
··· 1 + import type { ExpectStatic, PromisifyAssertion, Tester } from '@vitest/expect' 1 2 import type { Plugin as PrettyFormatPlugin } from '@vitest/pretty-format' 2 3 import type { SnapshotState } from '@vitest/snapshot' 3 - import type { ExpectStatic, PromisifyAssertion, Tester } from '@vitest/expect' 4 4 import type { VitestEnvironment } from '../node/types/config' 5 5 import type { BenchmarkResult } from '../runtime/types/benchmark' 6 6 import type { UserConsoleLog } from './general'
+4 -4
packages/vitest/src/types/worker.ts
··· 1 - import type { ModuleCacheMap, ViteNodeResolveId } from 'vite-node' 2 - import type { BirpcReturn } from 'birpc' 3 1 import type { CancelReason, Task } from '@vitest/runner' 2 + import type { BirpcReturn } from 'birpc' 3 + import type { ModuleCacheMap, ViteNodeResolveId } from 'vite-node' 4 4 import type { SerializedConfig } from '../runtime/config' 5 - import type { RunnerRPC, RuntimeRPC } from './rpc' 6 - import type { TransformMode } from './general' 7 5 import type { Environment } from './environment' 6 + import type { TransformMode } from './general' 7 + import type { RunnerRPC, RuntimeRPC } from './rpc' 8 8 9 9 /** @deprecated unused */ 10 10 export type ResolveIdFunction = (
+1 -1
packages/vitest/src/utils/base.ts
··· 1 - export { notNullish, getCallLastIndex, nanoid } from '@vitest/utils' 1 + export { getCallLastIndex, nanoid, notNullish } from '@vitest/utils' 2 2 3 3 export function groupBy<T, K extends string | number | symbol>( 4 4 collection: T[],
+1 -1
packages/vitest/src/utils/config-helpers.ts
··· 1 - import type { SerializedConfig } from '../node/types/config' 2 1 import type { 3 2 BenchmarkBuiltinReporters, 4 3 BuiltinReporters, 5 4 } from '../node/reporters' 5 + import type { SerializedConfig } from '../node/types/config' 6 6 7 7 const REGEXP_WRAP_PREFIX = '$$vitest:' 8 8
+6 -6
packages/vitest/src/utils/coverage.ts
··· 1 - import { existsSync, promises as fs, readdirSync, writeFileSync } from 'node:fs' 2 - import { relative, resolve } from 'pathe' 3 - import mm from 'micromatch' 4 - import c from 'tinyrainbow' 5 1 import type { CoverageMap } from 'istanbul-lib-coverage' 6 - import { coverageConfigDefaults } from '../defaults' 7 - import type { AfterSuiteRunMeta } from '../types/general' 8 2 import type { Vitest } from '../node/core' 9 3 import type { BaseCoverageOptions, ReportContext, ResolvedCoverageOptions } from '../node/types/coverage' 4 + import type { AfterSuiteRunMeta } from '../types/general' 5 + import { existsSync, promises as fs, readdirSync, writeFileSync } from 'node:fs' 6 + import mm from 'micromatch' 7 + import { relative, resolve } from 'pathe' 8 + import c from 'tinyrainbow' 9 + import { coverageConfigDefaults } from '../defaults' 10 10 import { resolveCoverageReporters } from '../node/config/resolveConfig' 11 11 12 12 type Threshold = 'lines' | 'functions' | 'statements' | 'branches'
+1 -1
packages/vitest/src/utils/memory-limit.ts
··· 5 5 * LICENSE file in the root directory of facebook/jest GitHub project tree. 6 6 */ 7 7 8 - import * as nodeos from 'node:os' 9 8 import type { ResolvedConfig } from '../node/types/config' 9 + import * as nodeos from 'node:os' 10 10 11 11 function getDefaultThreadsCount(config: ResolvedConfig) { 12 12 const numCpus
+2 -2
packages/vitest/src/utils/source-map.ts
··· 1 1 export { 2 2 lineSplitRE, 3 - positionToOffset, 4 3 offsetToLineNumber, 4 + positionToOffset, 5 5 } from '@vitest/utils' 6 6 export { 7 + parseErrorStacktrace, 7 8 parseSingleStack, 8 9 parseStacktrace, 9 - parseErrorStacktrace, 10 10 } from '@vitest/utils/source-map'
+2 -2
packages/vitest/src/utils/tasks.ts
··· 1 - import { getTests } from '@vitest/runner/utils' 2 1 import type { Suite, Task } from '@vitest/runner' 3 - import { toArray } from '@vitest/utils' 4 2 import type { Arrayable } from '../types/general' 3 + import { getTests } from '@vitest/runner/utils' 4 + import { toArray } from '@vitest/utils' 5 5 6 6 export function hasBenchmark(suite: Arrayable<Suite>): boolean { 7 7 return toArray(suite).some(s =>
+3 -3
packages/vitest/src/utils/test-helpers.ts
··· 1 - import { promises as fs } from 'node:fs' 2 - import mm from 'micromatch' 1 + import type { WorkspaceSpec } from '../node/pool' 3 2 import type { EnvironmentOptions, TransformModePatterns, VitestEnvironment } from '../node/types/config' 4 3 import type { ContextTestEnvironment } from '../types/worker' 5 - import type { WorkspaceSpec } from '../node/pool' 4 + import { promises as fs } from 'node:fs' 5 + import mm from 'micromatch' 6 6 import { groupBy } from './base' 7 7 8 8 export const envsOrder = ['node', 'jsdom', 'happy-dom', 'edge-runtime']
+1 -1
test/core/test/mocking/automocking.spec.ts
··· 1 - import { expect, test, vi } from 'vitest' 2 1 import type * as exampleModule from '../../src/mocks/example' 2 + import { expect, test, vi } from 'vitest' 3 3 import log from '../../src/mocks/log' 4 4 import { A } from '../../src/mocks/moduleA' 5 5 import { methodSymbol, moduleWithSymbol } from '../../src/mocks/moduleWithSymbol'
+1 -1
test/core/test/mocking/autospying.test.ts
··· 1 - import { expect, test, vi } from 'vitest' 2 1 import axios from 'axios' 2 + import { expect, test, vi } from 'vitest' 3 3 import { getAuthToken } from '../../src/env' 4 4 5 5 vi.mock(import('../../src/env'), { spy: true })
+1 -1
test/core/test/mocking/circular-mocks.spec.ts
··· 1 1 import { expect, test, vi } from 'vitest' 2 + import x from '../../src/mocks/export-default-circle-index.js' 2 3 // @ts-expect-error not typed 3 4 import { main, mainB } from '../../src/mocks/main.js' 4 - import x from '../../src/mocks/export-default-circle-index.js' 5 5 6 6 vi.mock('../../src/mocks/A', async () => ({ 7 7 ...(await vi.importActual<any>('../../src/mocks/A')),
+1 -1
test/core/test/mocking/destructured.test.ts
··· 1 1 import { expect, test, vi } from 'vitest' 2 + import { foo } from '../../src/mocks/set-foo.js' 2 3 // @ts-expect-error mocked module 3 4 import * as squaredModule from '../../src/mocks/squared' 4 5 // @ts-expect-error mocked module 5 6 import { squared } from '../../src/mocks/squared' 6 - import { foo } from '../../src/mocks/set-foo.js' 7 7 8 8 vi.mock('any') 9 9
+1 -2
test/core/test/mocking/error-mock.spec.ts
··· 5 5 }) 6 6 7 7 test('when using top level variable, gives helpful message', async () => { 8 - await expect(() => import('../../src/mocks/default').then(m => m.default)).rejects 9 - .toThrowErrorMatchingInlineSnapshot(`[Error: [vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock]`) 8 + await expect(() => import('../../src/mocks/default').then(m => m.default)).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: [vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock]`) 10 9 })
+2 -1
test/core/test/mocking/external.test.ts
··· 1 - import '../../src/mocks/external/external.mjs' 1 + /* eslint-disable perfectionist/sort-imports */ 2 2 import { expect, test, vi } from 'vitest' 3 + import '../../src/mocks/external/external.mjs' 3 4 import axios from 'axios' 4 5 // @ts-expect-error mocked module 5 6 import defaultFunc from '../../src/mocks/external/default-function.cjs'
+2 -3
test/core/test/mocking/factory.test.ts
··· 1 1 import axios from 'axios' 2 2 import { describe, expect, it, test, vi } from 'vitest' 3 3 import * as example from '../../src/mocks/example' 4 + import logger from '../../src/mocks/log' 4 5 import * as moduleA from '../../src/mocks/moduleA' 5 6 import * as moduleB from '../../src/mocks/moduleB' 6 - import logger from '../../src/mocks/log' 7 7 8 8 vi 9 9 .mock('../../src/mocks/example', () => ({ ··· 67 67 }) 68 68 69 69 it('non-object return on factory gives error', async () => { 70 - await expect(() => import('../../src/mocks/default.js').then(m => m.default)).rejects 71 - .toThrowError('[vitest] vi.mock("../../src/mocks/default.ts", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?') 70 + await expect(() => import('../../src/mocks/default.js').then(m => m.default)).rejects.toThrowError('[vitest] vi.mock("../../src/mocks/default.ts", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?') 72 71 }) 73 72 74 73 test('defined exports on mock', async () => {
+1 -1
test/core/test/mocking/self-importing.test.ts
··· 1 - import zustand from 'zustand' 2 1 import { describe, expect, test, vi } from 'vitest' 2 + import zustand from 'zustand' 3 3 import { magic } from '../../src/mocks/zustand-magic' 4 4 5 5 vi.mock('zustand')
+2 -2
examples/workspace/packages/client/test/basic.test.tsx
··· 1 - import React from 'react' 2 - import { expect, test } from 'vitest' 3 1 import { render, screen } from '@testing-library/react' 4 2 import { userEvent } from '@testing-library/user-event' 3 + import React from 'react' 4 + import { expect, test } from 'vitest' 5 5 import Link from '../components/Link.jsx' 6 6 7 7 test('Link changes the state when hovered', async () => {
+2 -2
examples/workspace/packages/server/test/app.test.ts
··· 1 - import { afterAll, expect, test } from 'vitest' 2 1 import supertest from 'supertest' 2 + import { afterAll, expect, test } from 'vitest' 3 3 4 - import app from '../src/app' 5 4 import { usersData } from '../mockData' 5 + import app from '../src/app' 6 6 7 7 test('with HTTP injection', async () => { 8 8 const response = await app.inject({
+2 -2
packages/browser/src/client/tester/context.ts
··· 1 - import type { RunnerTask } from 'vitest' 2 - import type { BrowserRPC } from '@vitest/browser/client' 3 1 import type { Options as TestingLibraryOptions, UserEvent as TestingLibraryUserEvent } from '@testing-library/user-event' 2 + import type { BrowserRPC } from '@vitest/browser/client' 3 + import type { RunnerTask } from 'vitest' 4 4 import type { 5 5 BrowserPage, 6 6 Locator,
+1 -1
packages/browser/src/client/tester/expect-element.ts
··· 1 - import * as matchers from '@testing-library/jest-dom/matchers' 2 1 import type { Locator } from '@vitest/browser/context' 3 2 import type { ExpectPollOptions } from 'vitest' 3 + import * as matchers from '@testing-library/jest-dom/matchers' 4 4 import { chai, expect } from 'vitest' 5 5 6 6 export async function setupExpectDom() {
+1 -1
packages/browser/src/client/tester/msw.ts
··· 1 - import { channel } from '@vitest/browser/client' 2 1 import type { 3 2 IframeChannelEvent, 4 3 IframeMockFactoryRequestEvent, 5 4 IframeMockingDoneEvent, 6 5 } from '@vitest/browser/client' 7 6 import type { MockedModuleSerialized } from '@vitest/mocker' 7 + import { channel } from '@vitest/browser/client' 8 8 import { ManualMockedModule } from '@vitest/mocker' 9 9 import { ModuleMockerMSWInterceptor } from '@vitest/mocker/browser' 10 10 import { nanoid } from '@vitest/utils'
+1 -1
packages/browser/src/client/tester/public-utils.ts
··· 1 1 import { type Locator, type LocatorSelectors, page } from '@vitest/browser/context' 2 - import { type StringifyOptions, stringify } from 'vitest/utils' 3 2 import { asLocator } from 'ivya' 3 + import { stringify, type StringifyOptions } from 'vitest/utils' 4 4 5 5 export function getElementLocatorSelectors(element: Element): LocatorSelectors { 6 6 const locator = page.elementLocator(element)
+1 -1
packages/browser/src/client/tester/rpc.ts
··· 1 - import { getSafeTimers } from 'vitest/utils' 2 1 import type { VitestBrowserClient } from '@vitest/browser/client' 2 + import { getSafeTimers } from 'vitest/utils' 3 3 4 4 const { get } = Reflect 5 5
+8 -8
packages/browser/src/client/tester/runner.ts
··· 1 1 import type { CancelReason, File, Suite, Task, TaskResultPack, VitestRunner } from '@vitest/runner' 2 2 import type { SerializedConfig, WorkerGlobalState } from 'vitest' 3 3 import type { VitestExecutor } from 'vitest/execute' 4 - import { NodeBenchmarkRunner, VitestTestRunner } from 'vitest/runners' 5 - import { loadDiffConfig, loadSnapshotSerializers, takeCoverageInsideWorker } from 'vitest/browser' 6 - import { TraceMap, originalPositionFor } from 'vitest/utils' 7 - import { page, userEvent } from '@vitest/browser/context' 8 - import { globalChannel } from '@vitest/browser/client' 9 - import { executor } from '../utils' 10 - import { VitestBrowserSnapshotEnvironment } from './snapshot' 11 - import { rpc } from './rpc' 12 4 import type { VitestBrowserClientMocker } from './mocker' 5 + import { globalChannel } from '@vitest/browser/client' 6 + import { page, userEvent } from '@vitest/browser/context' 7 + import { loadDiffConfig, loadSnapshotSerializers, takeCoverageInsideWorker } from 'vitest/browser' 8 + import { NodeBenchmarkRunner, VitestTestRunner } from 'vitest/runners' 9 + import { originalPositionFor, TraceMap } from 'vitest/utils' 10 + import { executor } from '../utils' 11 + import { rpc } from './rpc' 12 + import { VitestBrowserSnapshotEnvironment } from './snapshot' 13 13 14 14 interface BrowserRunnerOptions { 15 15 config: SerializedConfig
+2 -2
packages/browser/src/client/tester/snapshot.ts
··· 1 - import type { SnapshotEnvironment } from 'vitest/snapshot' 2 - import { type ParsedStack, TraceMap, originalPositionFor } from 'vitest/utils' 3 1 import type { VitestBrowserClient } from '@vitest/browser/client' 2 + import type { SnapshotEnvironment } from 'vitest/snapshot' 3 + import { originalPositionFor, type ParsedStack, TraceMap } from 'vitest/utils' 4 4 5 5 export class VitestBrowserSnapshotEnvironment implements SnapshotEnvironment { 6 6 private sourceMaps = new Map<string, any>()
+1 -1
packages/browser/src/client/tester/state.ts
··· 1 + import type { BrowserRPC } from '@vitest/browser/client' 1 2 import type { WorkerGlobalState } from 'vitest' 2 3 import { parse } from 'flatted' 3 - import type { BrowserRPC } from '@vitest/browser/client' 4 4 import { getBrowserState } from '../utils' 5 5 6 6 const config = getBrowserState().config
+4 -4
packages/browser/src/client/tester/tester.ts
··· 1 - import { SpyModule, collectTests, setupCommonEnv, startCoverageInsideWorker, startTests, stopCoverageInsideWorker } from 'vitest/browser' 2 - import { page, userEvent } from '@vitest/browser/context' 3 1 import type { IframeMockEvent, IframeMockInvalidateEvent, IframeUnmockEvent } from '@vitest/browser/client' 4 2 import { channel, client, onCancel, waitForChannel } from '@vitest/browser/client' 3 + import { page, userEvent } from '@vitest/browser/context' 4 + import { collectTests, setupCommonEnv, SpyModule, startCoverageInsideWorker, startTests, stopCoverageInsideWorker } from 'vitest/browser' 5 5 import { executor, getBrowserState, getConfig, getWorkerState } from '../utils' 6 6 import { setupDialogsSpy } from './dialog' 7 + import { setupExpectDom } from './expect-element' 7 8 import { setupConsoleLogSpy } from './logger' 9 + import { VitestBrowserClientMocker } from './mocker' 8 10 import { createSafeRpc } from './rpc' 9 11 import { browserHashMap, initiateRunner } from './runner' 10 - import { VitestBrowserClientMocker } from './mocker' 11 - import { setupExpectDom } from './expect-element' 12 12 13 13 const cleanupSymbol = Symbol.for('vitest:component-cleanup') 14 14
+1 -1
packages/browser/src/node/commands/clear.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const clear: UserEventCommand<UserEvent['clear']> = async ( 7 7 context,
+1 -1
packages/browser/src/node/commands/click.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const click: UserEventCommand<UserEvent['click']> = async ( 7 7 context,
+1 -1
packages/browser/src/node/commands/dragAndDrop.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const dragAndDrop: UserEventCommand<UserEvent['dragAndDrop']> = async ( 7 7 context,
+1 -1
packages/browser/src/node/commands/fill.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const fill: UserEventCommand<UserEvent['fill']> = async ( 7 7 context,
+3 -3
packages/browser/src/node/commands/fs.ts
··· 1 + import type { BrowserCommand, WorkspaceProject } from 'vitest/node' 2 + import type { BrowserCommands } from '../../../context' 1 3 import fs, { promises as fsp } from 'node:fs' 2 4 import { basename, dirname, resolve } from 'node:path' 3 - import { isFileServingAllowed } from 'vitest/node' 4 - import type { BrowserCommand, WorkspaceProject } from 'vitest/node' 5 5 import mime from 'mime/lite' 6 - import type { BrowserCommands } from '../../../context' 6 + import { isFileServingAllowed } from 'vitest/node' 7 7 8 8 function assertFileAccess(path: string, project: WorkspaceProject) { 9 9 if (
+1 -1
packages/browser/src/node/commands/hover.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const hover: UserEventCommand<UserEvent['hover']> = async ( 7 7 context,
+8 -8
packages/browser/src/node/commands/index.ts
··· 1 - import { click, dblClick, tripleClick } from './click' 2 - import { type } from './type' 3 1 import { clear } from './clear' 4 - import { fill } from './fill' 5 - import { selectOptions } from './select' 6 - import { tab } from './tab' 7 - import { keyboard, keyboardCleanup } from './keyboard' 2 + import { click, dblClick, tripleClick } from './click' 8 3 import { dragAndDrop } from './dragAndDrop' 9 - import { hover } from './hover' 10 - import { upload } from './upload' 4 + import { fill } from './fill' 11 5 import { 12 6 _fileInfo, 13 7 readFile, 14 8 removeFile, 15 9 writeFile, 16 10 } from './fs' 11 + import { hover } from './hover' 12 + import { keyboard, keyboardCleanup } from './keyboard' 17 13 import { screenshot } from './screenshot' 14 + import { selectOptions } from './select' 15 + import { tab } from './tab' 16 + import { type } from './type' 17 + import { upload } from './upload' 18 18 19 19 export default { 20 20 readFile,
+3 -3
packages/browser/src/node/commands/keyboard.ts
··· 1 - import { parseKeyDef } from '@testing-library/user-event/dist/esm/keyboard/parseKeyDef.js' 2 - import { defaultKeyMap } from '@testing-library/user-event/dist/esm/keyboard/keyMap.js' 3 1 import type { BrowserProvider } from 'vitest/node' 2 + import type { UserEventCommand } from './utils' 3 + import { defaultKeyMap } from '@testing-library/user-event/dist/esm/keyboard/keyMap.js' 4 + import { parseKeyDef } from '@testing-library/user-event/dist/esm/keyboard/parseKeyDef.js' 4 5 import { PlaywrightBrowserProvider } from '../providers/playwright' 5 6 import { WebdriverBrowserProvider } from '../providers/webdriver' 6 - import type { UserEventCommand } from './utils' 7 7 8 8 export interface KeyboardState { 9 9 unreleased: string[]
+2 -2
packages/browser/src/node/commands/screenshot.ts
··· 1 + import type { BrowserCommand, ResolvedConfig } from 'vitest/node' 2 + import type { ScreenshotOptions } from '../../../context' 1 3 import { mkdir } from 'node:fs/promises' 2 4 import { normalize } from 'node:path' 3 - import type { BrowserCommand, ResolvedConfig } from 'vitest/node' 4 5 import { basename, dirname, relative, resolve } from 'pathe' 5 - import type { ScreenshotOptions } from '../../../context' 6 6 import { PlaywrightBrowserProvider } from '../providers/playwright' 7 7 import { WebdriverBrowserProvider } from '../providers/webdriver' 8 8
+1 -1
packages/browser/src/node/commands/select.ts
··· 1 1 import type { ElementHandle } from 'playwright' 2 2 import type { UserEvent } from '../../../context' 3 + import type { UserEventCommand } from './utils' 3 4 import { PlaywrightBrowserProvider } from '../providers/playwright' 4 5 import { WebdriverBrowserProvider } from '../providers/webdriver' 5 - import type { UserEventCommand } from './utils' 6 6 7 7 export const selectOptions: UserEventCommand<UserEvent['selectOptions']> = async ( 8 8 context,
+1 -1
packages/browser/src/node/commands/tab.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const tab: UserEventCommand<UserEvent['tab']> = async ( 7 7 context,
+1 -1
packages/browser/src/node/commands/type.ts
··· 1 1 import type { UserEvent } from '../../../context' 2 + import type { UserEventCommand } from './utils' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 import { keyboardImplementation } from './keyboard' 6 6 7 7 export const type: UserEventCommand<UserEvent['type']> = async (
+1 -1
packages/browser/src/node/commands/upload.ts
··· 1 + import type { UserEventCommand } from './utils' 1 2 import { dirname, resolve } from 'pathe' 2 3 import { PlaywrightBrowserProvider } from '../providers/playwright' 3 4 import { WebdriverBrowserProvider } from '../providers/webdriver' 4 - import type { UserEventCommand } from './utils' 5 5 6 6 export const upload: UserEventCommand<(element: string, files: Array<string | { 7 7 name: string
+5 -5
packages/browser/src/node/plugins/pluginContext.ts
··· 1 - import { fileURLToPath } from 'node:url' 1 + import type { PluginContext } from 'rollup' 2 2 import type { Plugin } from 'vitest/config' 3 3 import type { BrowserProvider } from 'vitest/node' 4 - import { dirname, resolve } from 'pathe' 5 - import type { PluginContext } from 'rollup' 6 - import { slash } from '@vitest/utils' 7 - import builtinCommands from '../commands/index' 8 4 import type { BrowserServer } from '../server' 5 + import { fileURLToPath } from 'node:url' 6 + import { slash } from '@vitest/utils' 7 + import { dirname, resolve } from 'pathe' 8 + import builtinCommands from '../commands/index' 9 9 10 10 const VIRTUAL_ID_CONTEXT = '\0@vitest/browser/context' 11 11 const ID_CONTEXT = '@vitest/browser/context'
+1 -1
packages/browser/src/node/providers/index.ts
··· 1 1 import { PlaywrightBrowserProvider } from './playwright' 2 - import { WebdriverBrowserProvider } from './webdriver' 3 2 import { PreviewBrowserProvider } from './preview' 3 + import { WebdriverBrowserProvider } from './webdriver' 4 4 5 5 export const webdriverio = WebdriverBrowserProvider 6 6 export const playwright = PlaywrightBrowserProvider
+2 -2
packages/ui/client/components/dashboard/DashboardEntry.spec.ts
··· 1 + import { faker } from '@faker-js/faker' 1 2 import { describe, expect, it } from 'vitest' 2 3 import { h } from 'vue' 3 - import { faker } from '@faker-js/faker' 4 - import DashboardEntry from './DashboardEntry.vue' 5 4 import { render, screen } from '~/test' 5 + import DashboardEntry from './DashboardEntry.vue' 6 6 7 7 const bodyTestId = 'body-content' 8 8 const headerTestId = 'header-content'
+4 -4
packages/ui/client/components/explorer/Explorer.vue
··· 5 5 // @ts-expect-error missing types 6 6 import { RecycleScroller } from 'vue-virtual-scroller' 7 7 8 - import { activeFileId } from '~/composables/params' 8 + import { config } from '~/composables/client' 9 9 import { useSearch } from '~/composables/explorer/search' 10 10 11 - import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' 12 - import { config } from '~/composables/client' 13 - 14 11 import { panels } from '~/composables/navigation' 12 + import { activeFileId } from '~/composables/params' 13 + 14 + import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' 15 15 16 16 defineOptions({ inheritAttrs: false }) 17 17
+4 -4
packages/ui/client/components/explorer/ExplorerItem.vue
··· 1 1 <script setup lang="ts"> 2 2 import type { Task, TaskState } from '@vitest/runner' 3 - import { nextTick } from 'vue' 4 3 import { hasFailedSnapshot } from '@vitest/ws-client' 5 4 import { Tooltip as VueTooltip } from 'floating-vue' 5 + import { nextTick } from 'vue' 6 6 import { client, isReport, runFiles } from '~/composables/client' 7 - import { coverageEnabled } from '~/composables/navigation' 8 - import type { TaskTreeNodeType } from '~/composables/explorer/types' 7 + import { showSource } from '~/composables/codemirror' 9 8 import { explorerTree } from '~/composables/explorer' 10 9 import { escapeHtml, highlightRegex } from '~/composables/explorer/state' 11 - import { showSource } from '~/composables/codemirror' 10 + import type { TaskTreeNodeType } from '~/composables/explorer/types' 11 + import { coverageEnabled } from '~/composables/navigation' 12 12 13 13 // TODO: better handling of "opened" - it means to forcefully open the tree item and set in TasksList right now 14 14 const {
+1 -1
packages/ui/client/components/views/ViewConsoleOutputEntry.spec.ts
··· 1 1 import Filter from 'ansi-to-html' 2 2 import { describe, expect, it } from 'vitest' 3 - import ViewConsoleOutputEntry from './ViewConsoleOutputEntry.vue' 4 3 import { render } from '~/test' 4 + import ViewConsoleOutputEntry from './ViewConsoleOutputEntry.vue' 5 5 6 6 describe('ViewConsoleOutputEntry', () => { 7 7 it('test html entry', () => {
+1 -1
packages/ui/client/components/views/ViewEditor.vue
··· 2 2 import type CodeMirror from 'codemirror' 3 3 import type { ErrorWithDiff, File } from 'vitest' 4 4 import { createTooltip, destroyTooltip } from 'floating-vue' 5 - import { openInEditor } from '~/composables/error' 6 5 import { client, isReport } from '~/composables/client' 7 6 import { codemirrorRef } from '~/composables/codemirror' 7 + import { openInEditor } from '~/composables/error' 8 8 import { lineNumber } from '~/composables/params' 9 9 10 10 const props = defineProps<{
+2 -2
packages/ui/client/components/views/ViewModuleGraph.vue
··· 1 1 <script setup lang="ts"> 2 2 import type { ResizeContext } from 'd3-graph-controller' 3 + import type { Selection } from 'd3-selection' 3 4 import { 5 + defineGraphConfig, 4 6 GraphController, 5 7 Markers, 6 8 PositionInitializers, 7 - defineGraphConfig, 8 9 } from 'd3-graph-controller' 9 - import type { Selection } from 'd3-selection' 10 10 import { isReport } from '~/composables/client' 11 11 import type { 12 12 ModuleGraph,
+3 -3
packages/ui/client/components/views/ViewReport.spec.ts
··· 1 - import { faker } from '@faker-js/faker' 2 1 import type { File } from 'vitest' 2 + import { faker } from '@faker-js/faker' 3 3 import { beforeEach, describe, expect, it } from 'vitest' 4 - import ViewReport from './ViewReport.vue' 5 - import { render, screen, within } from '~/test' 6 4 import { config } from '~/composables/client' 5 + import { render, screen, within } from '~/test' 6 + import ViewReport from './ViewReport.vue' 7 7 8 8 config.value.root = '' 9 9
+2 -2
packages/ui/client/components/views/ViewReport.vue
··· 1 1 <script setup lang="ts"> 2 - import type { ErrorWithDiff, File, Suite, Task } from 'vitest' 3 2 import type Convert from 'ansi-to-html' 3 + import type { ErrorWithDiff, File, Suite, Task } from 'vitest' 4 + import { browserState, config } from '~/composables/client' 4 5 import { isDark } from '~/composables/dark' 5 6 import { createAnsiToHtmlFilter } from '~/composables/error' 6 - import { browserState, config } from '~/composables/client' 7 7 import { escapeHtml } from '~/utils/escape' 8 8 9 9 const props = defineProps<{
+8 -8
packages/ui/client/composables/client/index.ts
··· 1 - import { createClient, getTasks } from '@vitest/ws-client' 2 1 import type { WebSocketStatus } from '@vueuse/core' 3 2 import type { File, SerializedConfig, TaskResultPack } from 'vitest' 4 - import { reactive as reactiveVue } from 'vue' 5 - import { createFileTask } from '@vitest/runner/utils' 6 3 import type { BrowserRunnerState } from '../../../types' 4 + import { createFileTask } from '@vitest/runner/utils' 5 + import { createClient, getTasks } from '@vitest/ws-client' 6 + import { reactive as reactiveVue } from 'vue' 7 + import { explorerTree } from '~/composables/explorer' 8 + import { isFileNode } from '~/composables/explorer/utils' 9 + import { ui } from '../../composables/api' 7 10 import { ENTRY_URL, isReport } from '../../constants' 8 11 import { parseError } from '../error' 9 12 import { activeFileId } from '../params' 10 - import { ui } from '../../composables/api' 11 - import { createStaticClient } from './static' 12 13 import { testRunState, unhandledErrors } from './state' 13 - import { explorerTree } from '~/composables/explorer' 14 - import { isFileNode } from '~/composables/explorer/utils' 14 + import { createStaticClient } from './static' 15 15 16 - export { ENTRY_URL, PORT, HOST, isReport } from '../../constants' 16 + export { ENTRY_URL, HOST, isReport, PORT } from '../../constants' 17 17 18 18 export const client = (function createVitestClient() { 19 19 if (isReport) {
+1 -1
packages/ui/client/composables/client/state.ts
··· 1 - import type { Ref } from 'vue' 2 1 import type { ErrorWithDiff } from '@vitest/utils' 2 + import type { Ref } from 'vue' 3 3 import type { RunState } from '../../../types' 4 4 5 5 export const testRunState: Ref<RunState> = ref('idle')
+2 -2
packages/ui/client/composables/client/static.ts
··· 1 - import type { BirpcReturn } from 'birpc' 2 1 import type { VitestClient } from '@vitest/ws-client' 2 + import type { BirpcReturn } from 'birpc' 3 3 import type { 4 4 File, 5 5 ModuleGraphData, ··· 7 7 WebSocketEvents, 8 8 WebSocketHandlers, 9 9 } from 'vitest' 10 - import { parse } from 'flatted' 11 10 import { decompressSync, strFromU8 } from 'fflate' 11 + import { parse } from 'flatted' 12 12 import { StateManager } from '../../../../ws-client/src/state' 13 13 14 14 interface HTMLReportMetadata {
+2 -2
packages/ui/client/composables/explorer/collapse.ts
··· 1 + import { explorerTree } from '~/composables/explorer/index' 2 + import { openedTreeItems, treeFilter, uiEntries } from '~/composables/explorer/state' 1 3 import type { UITaskTreeNode } from '~/composables/explorer/types' 2 4 import { isFileNode, isParentNode } from '~/composables/explorer/utils' 3 - import { openedTreeItems, treeFilter, uiEntries } from '~/composables/explorer/state' 4 - import { explorerTree } from '~/composables/explorer/index' 5 5 6 6 /** 7 7 * Collapse all nodes: all children collapsed.
+11 -11
packages/ui/client/composables/explorer/collector.ts
··· 1 1 import type { Custom, File, Task, TaskResultPack, Test } from '@vitest/runner' 2 - import { isAtomTest } from '@vitest/runner/utils' 3 2 import type { Arrayable } from '@vitest/utils' 3 + import { isAtomTest } from '@vitest/runner/utils' 4 4 import { toArray } from '@vitest/utils' 5 5 import { hasFailedSnapshot } from '@vitest/ws-client' 6 - import type { CollectFilteredTests, CollectorInfo, Filter, FilteredTests } from '~/composables/explorer/types' 7 6 import { client, findById } from '~/composables/client' 7 + import { expandNodesOnEndRun } from '~/composables/explorer/expand' 8 8 import { runFilter, testMatcher } from '~/composables/explorer/filter' 9 - import { 10 - createOrUpdateFileNode, 11 - createOrUpdateNodeTask, 12 - createOrUpdateSuiteTask, 13 - isRunningTestNode, 14 - } from '~/composables/explorer/utils' 15 - import { isSuite } from '~/utils/task' 9 + import { explorerTree } from '~/composables/explorer/index' 16 10 import { 17 11 initialized, 18 12 openedTreeItems, ··· 20 14 uiEntries, 21 15 uiFiles, 22 16 } from '~/composables/explorer/state' 23 - import { explorerTree } from '~/composables/explorer/index' 24 - import { expandNodesOnEndRun } from '~/composables/explorer/expand' 17 + import type { CollectFilteredTests, CollectorInfo, Filter, FilteredTests } from '~/composables/explorer/types' 18 + import { 19 + createOrUpdateFileNode, 20 + createOrUpdateNodeTask, 21 + createOrUpdateSuiteTask, 22 + isRunningTestNode, 23 + } from '~/composables/explorer/utils' 24 + import { isSuite } from '~/utils/task' 25 25 26 26 export function runLoadFiles( 27 27 remoteFiles: File[],
+3 -3
packages/ui/client/composables/explorer/expand.ts
··· 1 + import { findById } from '~/composables/client' 2 + import { filterAll, filterNode } from '~/composables/explorer/filter' 3 + import { explorerTree } from '~/composables/explorer/index' 1 4 import { filteredFiles, openedTreeItems, treeFilter, uiEntries } from '~/composables/explorer/state' 2 5 import type { Filter, UITaskTreeNode } from '~/composables/explorer/types' 3 6 import { createOrUpdateNode, createOrUpdateSuiteTask, isFileNode, isParentNode } from '~/composables/explorer/utils' 4 - import { filterAll, filterNode } from '~/composables/explorer/filter' 5 - import { findById } from '~/composables/client' 6 - import { explorerTree } from '~/composables/explorer/index' 7 7 8 8 /** 9 9 * Expand the node: only direct children will be expanded
+4 -4
packages/ui/client/composables/explorer/filter.ts
··· 1 1 import type { Task } from '@vitest/runner' 2 - import { caseInsensitiveMatch } from '~/utils/task' 2 + import { client, findById } from '~/composables/client' 3 + import { explorerTree } from '~/composables/explorer/index' 4 + import { filteredFiles, uiEntries } from '~/composables/explorer/state' 3 5 import type { FileTreeNode, Filter, FilterResult, ParentTreeNode, UITaskTreeNode } from '~/composables/explorer/types' 4 6 import { 5 7 isFileNode, ··· 7 9 isTestNode, 8 10 sortedRootTasks, 9 11 } from '~/composables/explorer/utils' 10 - import { client, findById } from '~/composables/client' 11 - import { filteredFiles, uiEntries } from '~/composables/explorer/state' 12 - import { explorerTree } from '~/composables/explorer/index' 12 + import { caseInsensitiveMatch } from '~/utils/task' 13 13 14 14 export function testMatcher(task: Task, search: string, filter: Filter) { 15 15 return task ? matchTask(task, search, filter) : false
+1 -1
packages/ui/client/composables/explorer/search.ts
··· 1 1 import type { Ref } from 'vue' 2 + import { explorerTree } from '~/composables/explorer' 2 3 import { 3 4 filter, 4 5 filteredFiles, ··· 11 12 treeFilter, 12 13 uiEntries, 13 14 } from './state' 14 - import { explorerTree } from '~/composables/explorer' 15 15 16 16 export function useSearch(searchBox: Ref<HTMLDivElement | undefined>) { 17 17 const disableFilter = computed(() => {
+4 -4
packages/ui/client/composables/explorer/tree.ts
··· 1 1 import type { File, TaskResultPack } from '@vitest/runner' 2 + import { runCollapseAllTask, runCollapseNode } from '~/composables/explorer/collapse' 3 + import { collectTestsTotalData, preparePendingTasks, runCollect, runLoadFiles } from '~/composables/explorer/collector' 4 + import { runExpandAll, runExpandNode } from '~/composables/explorer/expand' 5 + import { runFilter } from '~/composables/explorer/filter' 2 6 import { 3 7 filter, 4 8 search, ··· 9 13 RootTreeNode, 10 14 UITaskTreeNode, 11 15 } from '~/composables/explorer/types' 12 - import { collectTestsTotalData, preparePendingTasks, runCollect, runLoadFiles } from '~/composables/explorer/collector' 13 - import { runCollapseAllTask, runCollapseNode } from '~/composables/explorer/collapse' 14 - import { runExpandAll, runExpandNode } from '~/composables/explorer/expand' 15 - import { runFilter } from '~/composables/explorer/filter' 16 16 17 17 export class ExplorerTree { 18 18 private rafCollector: ReturnType<typeof useRafFn>
+3 -3
packages/ui/client/composables/explorer/utils.ts
··· 1 1 import type { File, Task } from '@vitest/runner' 2 2 import { isAtomTest } from '@vitest/runner/utils' 3 + import { client } from '~/composables/client' 4 + import { explorerTree } from '~/composables/explorer/index' 5 + import { openedTreeItemsSet } from '~/composables/explorer/state' 3 6 import type { 4 7 CustomTestTreeNode, 5 8 FileTreeNode, ··· 8 11 TestTreeNode, 9 12 UITaskTreeNode, 10 13 } from '~/composables/explorer/types' 11 - import { client } from '~/composables/client' 12 14 import { getProjectNameColor, isSuite as isTaskSuite } from '~/utils/task' 13 - import { explorerTree } from '~/composables/explorer/index' 14 - import { openedTreeItemsSet } from '~/composables/explorer/state' 15 15 16 16 export function isTestNode(node: UITaskTreeNode): node is TestTreeNode | CustomTestTreeNode { 17 17 return node.type === 'test' || node.type === 'custom'
+5 -5
packages/vitest/src/create/browser/creator.ts
··· 1 - import { dirname, relative, resolve } from 'node:path' 1 + import type { Agent } from '@antfu/install-pkg' 2 + import type { BrowserBuiltinProvider } from '../../node/types/browser' 2 3 import { existsSync, readFileSync } from 'node:fs' 3 4 import { writeFile } from 'node:fs/promises' 4 - import prompt from 'prompts' 5 - import c from 'tinyrainbow' 6 - import type { Agent } from '@antfu/install-pkg' 5 + import { dirname, relative, resolve } from 'node:path' 7 6 import { detectPackageManager, installPackage } from '@antfu/install-pkg' 8 7 import { findUp } from 'find-up' 8 + import prompt from 'prompts' 9 9 import { x } from 'tinyexec' 10 - import type { BrowserBuiltinProvider } from '../../node/types/browser' 10 + import c from 'tinyrainbow' 11 11 import { configFiles } from '../../constants' 12 12 import { generateExampleFiles } from './examples' 13 13
+6 -6
packages/vitest/src/integrations/chai/index.ts
··· 1 1 // CI failes only for this file, but it works locally 2 2 3 - import * as chai from 'chai' 4 - import './setup' 3 + import type { Assertion, ExpectStatic, MatcherState } from '@vitest/expect' 5 4 import type { TaskPopulated, Test } from '@vitest/runner' 6 - import { getCurrentTest } from '@vitest/runner' 7 5 import { 8 - ASYMMETRIC_MATCHERS_OBJECT, 9 - GLOBAL_EXPECT, 10 6 addCustomEqualityTesters, 7 + ASYMMETRIC_MATCHERS_OBJECT, 11 8 getState, 9 + GLOBAL_EXPECT, 12 10 setState, 13 11 } from '@vitest/expect' 14 - import type { Assertion, ExpectStatic, MatcherState } from '@vitest/expect' 12 + import { getCurrentTest } from '@vitest/runner' 15 13 import { getTestName } from '@vitest/runner/utils' 14 + import * as chai from 'chai' 16 15 import { getCurrentEnvironment, getWorkerState } from '../../runtime/utils' 17 16 import { createExpectPoll } from './poll' 17 + import './setup' 18 18 19 19 export function createExpect(test?: TaskPopulated) { 20 20 const expect = ((value: any, message?: string): Assertion => {
+1 -1
packages/vitest/src/integrations/chai/poll.ts
··· 1 - import * as chai from 'chai' 2 1 import type { Assertion, ExpectStatic } from '@vitest/expect' 3 2 import { getSafeTimers } from '@vitest/utils' 3 + import * as chai from 'chai' 4 4 import { getWorkerState } from '../../runtime/utils' 5 5 6 6 // these matchers are not supported because they don't make sense with poll
+2 -2
packages/vitest/src/integrations/chai/setup.ts
··· 1 - import * as chai from 'chai' 2 - import Subset from 'chai-subset' 3 1 import { 4 2 JestAsymmetricMatchers, 5 3 JestChaiExpect, 6 4 JestExtend, 7 5 } from '@vitest/expect' 6 + import * as chai from 'chai' 7 + import Subset from 'chai-subset' 8 8 import { SnapshotPlugin } from '../snapshot/chai' 9 9 10 10 chai.use(JestExtend)
+1 -1
packages/vitest/src/integrations/css/css-modules.ts
··· 1 - import { hash } from '../../node/hash' 2 1 import type { CSSModuleScopeStrategy } from '../../node/types/config' 2 + import { hash } from '../../node/hash' 3 3 4 4 export function generateCssFilenameHash(filepath: string) { 5 5 return hash('md5', filepath, 'hex').slice(0, 6)
+1 -1
packages/vitest/src/integrations/env/edge-runtime.ts
··· 1 1 import type { Environment } from '../../types/environment' 2 - import { populateGlobal } from './utils' 3 2 import { KEYS } from './jsdom-keys' 3 + import { populateGlobal } from './utils' 4 4 5 5 export default <Environment>{ 6 6 name: 'edge-runtime',
+3 -3
packages/vitest/src/integrations/env/index.ts
··· 1 - import node from './node' 2 - import jsdom from './jsdom' 3 - import happy from './happy-dom' 4 1 import edge from './edge-runtime' 2 + import happy from './happy-dom' 3 + import jsdom from './jsdom' 4 + import node from './node' 5 5 6 6 export const environments = { 7 7 node,
+4 -4
packages/vitest/src/integrations/env/loader.ts
··· 1 + import type { ViteNodeRunnerOptions } from 'vite-node' 2 + import type { BuiltinEnvironment, VitestEnvironment } from '../../node/types/config' 3 + import type { Environment } from '../../types/environment' 4 + import type { ContextRPC, WorkerRPC } from '../../types/worker' 1 5 import { readFileSync } from 'node:fs' 2 6 import { normalize, resolve } from 'pathe' 3 7 import { ViteNodeRunner } from 'vite-node/client' 4 - import type { ViteNodeRunnerOptions } from 'vite-node' 5 - import type { BuiltinEnvironment, VitestEnvironment } from '../../node/types/config' 6 - import type { ContextRPC, WorkerRPC } from '../../types/worker' 7 - import type { Environment } from '../../types/environment' 8 8 import { environments } from './index' 9 9 10 10 function isBuiltinEnvironment(
+1 -1
packages/vitest/src/integrations/env/node.ts
··· 1 - import { Console } from 'node:console' 2 1 import type { Environment } from '../../types/environment' 2 + import { Console } from 'node:console' 3 3 4 4 // some globals we do not want, either because deprecated or we set it ourselves 5 5 const denyList = new Set([
+1 -1
packages/vitest/src/integrations/mock/timers.ts
··· 12 12 } from '@sinonjs/fake-timers' 13 13 import { withGlobal } from '@sinonjs/fake-timers' 14 14 import { isChildProcess } from '../../runtime/utils' 15 - import { RealDate, mockDate, resetDate } from './date' 15 + import { mockDate, RealDate, resetDate } from './date' 16 16 17 17 export class FakeTimers { 18 18 private _global: typeof globalThis
+3 -3
packages/vitest/src/integrations/snapshot/chai.ts
··· 1 1 import type { ChaiPlugin } from '@vitest/expect' 2 + import type { Test } from '@vitest/runner' 2 3 import { equals, iterableEquality, subsetEquality } from '@vitest/expect' 4 + import { getNames } from '@vitest/runner/utils' 3 5 import { 4 - SnapshotClient, 5 6 addSerializer, 7 + SnapshotClient, 6 8 stripSnapshotIndentation, 7 9 } from '@vitest/snapshot' 8 - import type { Test } from '@vitest/runner' 9 - import { getNames } from '@vitest/runner/utils' 10 10 import { recordAsyncExpect } from '../../../../expect/src/utils' 11 11 12 12 let _client: SnapshotClient
+2 -2
packages/vitest/src/node/cache/files.ts
··· 1 - import fs from 'node:fs' 2 1 import type { Stats } from 'node:fs' 3 - import { relative } from 'pathe' 4 2 import type { WorkspaceSpec } from '../pool' 3 + import fs from 'node:fs' 4 + import { relative } from 'pathe' 5 5 6 6 type FileStatsCache = Pick<Stats, 'size'> 7 7
+1 -1
packages/vitest/src/node/cache/index.ts
··· 1 - import { resolve } from 'pathe' 2 1 import { slash } from '@vitest/utils' 2 + import { resolve } from 'pathe' 3 3 import { hash } from '../hash' 4 4 import { FilesStatsCache } from './files' 5 5 import { ResultsCache } from './results'
+2 -2
packages/vitest/src/node/cache/results.ts
··· 1 - import fs from 'node:fs' 2 - import { dirname, relative, resolve } from 'pathe' 3 1 import type { File } from '@vitest/runner' 4 2 import type { ResolvedConfig } from '../types/config' 3 + import fs from 'node:fs' 4 + import { dirname, relative, resolve } from 'pathe' 5 5 6 6 export interface SuiteResultCache { 7 7 failed: boolean
+5 -5
packages/vitest/src/node/cli/cac.ts
··· 1 - import { normalize } from 'pathe' 2 - import cac, { type CAC, type Command } from 'cac' 3 - import c from 'tinyrainbow' 4 - import { toArray } from '@vitest/utils' 5 - import { version } from '../../../package.json' with { type: 'json' } 6 1 import type { VitestRunMode } from '../types/config' 7 2 import type { CliOptions } from './cli-api' 8 3 import type { CLIOption, CLIOptions as CLIOptionsConfig } from './cli-config' 4 + import { toArray } from '@vitest/utils' 5 + import cac, { type CAC, type Command } from 'cac' 6 + import { normalize } from 'pathe' 7 + import c from 'tinyrainbow' 8 + import { version } from '../../../package.json' with { type: 'json' } 9 9 import { benchCliOptionsConfig, cliOptionsConfig, collectCliOptionsConfig } from './cli-config' 10 10 11 11 function addCommand(cli: CAC | Command, name: string, option: CLIOption<any>) {
+9 -11
packages/vitest/src/node/cli/cli-api.ts
··· 1 - /* eslint-disable no-console */ 2 - 3 - import { mkdirSync, writeFileSync } from 'node:fs' 4 - import { dirname, relative, resolve } from 'pathe' 5 - import type { UserConfig as ViteUserConfig } from 'vite' 6 1 import type { File, Suite, Task } from '@vitest/runner' 7 - import { getNames, getTests } from '@vitest/runner/utils' 8 - import { CoverageProviderMap } from '../../integrations/coverage' 2 + import type { UserConfig as ViteUserConfig } from 'vite' 9 3 import type { environments } from '../../integrations/env' 10 - import { createVitest } from '../create' 11 - import { registerConsoleShortcuts } from '../stdin' 12 4 import type { Vitest, VitestOptions } from '../core' 13 - import { FilesNotFoundError, GitNotFoundError } from '../errors' 14 - import type { UserConfig, VitestEnvironment, VitestRunMode } from '../types/config' 15 5 import type { WorkspaceSpec } from '../pool' 6 + import type { UserConfig, VitestEnvironment, VitestRunMode } from '../types/config' 7 + import { mkdirSync, writeFileSync } from 'node:fs' 8 + import { getNames, getTests } from '@vitest/runner/utils' 9 + import { dirname, relative, resolve } from 'pathe' 10 + import { CoverageProviderMap } from '../../integrations/coverage' 11 + import { createVitest } from '../create' 12 + import { FilesNotFoundError, GitNotFoundError } from '../errors' 13 + import { registerConsoleShortcuts } from '../stdin' 16 14 17 15 export interface CliOptions extends UserConfig { 18 16 /**
+1 -1
packages/vitest/src/node/cli/cli-config.ts
··· 1 - import { defaultBrowserPort, defaultPort } from '../../constants' 2 1 import type { ApiConfig } from '../types/config' 3 2 import type { 4 3 ForksOptions, ··· 7 6 WorkerContextOptions, 8 7 } from '../types/pool-options' 9 8 import type { CliOptions } from './cli-api' 9 + import { defaultBrowserPort, defaultPort } from '../../constants' 10 10 11 11 type NestedOption<T, V = Extract<T, Record<string, any>>> = V extends 12 12 | never
+10 -10
packages/vitest/src/node/config/resolveConfig.ts
··· 1 - import { resolveModule } from 'local-pkg' 2 - import { normalize, relative, resolve } from 'pathe' 3 - import c from 'tinyrainbow' 4 1 import type { ResolvedConfig as ResolvedViteConfig } from 'vite' 5 - import { toArray } from '@vitest/utils' 6 - import { isCI, stdProvider } from '../../utils/env' 2 + import type { Logger } from '../logger' 3 + import type { BenchmarkBuiltinReporters } from '../reporters' 7 4 import type { 8 5 ApiConfig, 9 6 ResolvedConfig, 10 7 UserConfig, 11 8 VitestRunMode, 12 9 } from '../types/config' 10 + import type { BaseCoverageOptions, CoverageReporterWithOptions } from '../types/coverage' 11 + import type { BuiltinPool, ForksOptions, PoolOptions, ThreadsOptions } from '../types/pool-options' 12 + import { toArray } from '@vitest/utils' 13 + import { resolveModule } from 'local-pkg' 14 + import { normalize, relative, resolve } from 'pathe' 15 + import c from 'tinyrainbow' 13 16 import { 14 17 defaultBrowserPort, 15 18 defaultInspectPort, ··· 17 20 extraInlineDeps, 18 21 } from '../../constants' 19 22 import { benchmarkConfigDefaults, configDefaults } from '../../defaults' 20 - import type { BuiltinPool, ForksOptions, PoolOptions, ThreadsOptions } from '../types/pool-options' 23 + import { isCI, stdProvider } from '../../utils/env' 21 24 import { getWorkersCountByPercentage } from '../../utils/workers' 22 25 import { VitestCache } from '../cache' 26 + import { builtinPools } from '../pool' 23 27 import { BaseSequencer } from '../sequencers/BaseSequencer' 24 28 import { RandomSequencer } from '../sequencers/RandomSequencer' 25 - import type { BenchmarkBuiltinReporters } from '../reporters' 26 - import { builtinPools } from '../pool' 27 - import type { Logger } from '../logger' 28 - import type { BaseCoverageOptions, CoverageReporterWithOptions } from '../types/coverage' 29 29 30 30 function resolvePath(path: string, root: string) { 31 31 return normalize(
+2 -2
packages/vitest/src/node/plugins/coverageTransform.ts
··· 1 1 import type { Plugin as VitePlugin } from 'vite' 2 - import { normalizeRequestId } from 'vite-node/utils' 3 - 4 2 import type { Vitest } from '../core' 3 + 4 + import { normalizeRequestId } from 'vite-node/utils' 5 5 6 6 export function CoverageTransform(ctx: Vitest): VitePlugin { 7 7 return {
+3 -3
packages/vitest/src/node/plugins/cssEnabler.ts
··· 1 - import { relative } from 'pathe' 2 1 import type { Plugin as VitePlugin } from 'vite' 3 - import { toArray } from '@vitest/utils' 4 - import { generateCssFilenameHash } from '../../integrations/css/css-modules' 5 2 import type { CSSModuleScopeStrategy, ResolvedConfig } from '../types/config' 3 + import { toArray } from '@vitest/utils' 4 + import { relative } from 'pathe' 5 + import { generateCssFilenameHash } from '../../integrations/css/css-modules' 6 6 7 7 const cssLangs = '\\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\\?)' 8 8 const cssLangRE = new RegExp(cssLangs)
+8 -8
packages/vitest/src/node/plugins/index.ts
··· 1 1 import type { UserConfig as ViteConfig, Plugin as VitePlugin } from 'vite' 2 - import { relative } from 'pathe' 2 + import type { ResolvedConfig, UserConfig } from '../types/config' 3 3 import { 4 4 deepMerge, 5 5 notNullish, 6 6 toArray, 7 7 } from '@vitest/utils' 8 + import { relative } from 'pathe' 9 + import { defaultPort } from '../../constants' 8 10 import { configDefaults, coverageConfigDefaults } from '../../defaults' 9 - import type { ResolvedConfig, UserConfig } from '../types/config' 11 + import { generateScopedClassName } from '../../integrations/css/css-modules' 10 12 import { resolveApiServerConfig } from '../config/resolveConfig' 11 13 import { Vitest } from '../core' 12 - import { generateScopedClassName } from '../../integrations/css/css-modules' 13 - import { defaultPort } from '../../constants' 14 14 import { createViteLogger } from '../viteLogger' 15 - import { SsrReplacerPlugin } from './ssrReplacer' 16 - import { CSSEnablerPlugin } from './cssEnabler' 17 15 import { CoverageTransform } from './coverageTransform' 16 + import { CSSEnablerPlugin } from './cssEnabler' 18 17 import { MocksPlugins } from './mocks' 18 + import { NormalizeURLPlugin } from './normalizeURL' 19 + import { VitestOptimizer } from './optimizer' 20 + import { SsrReplacerPlugin } from './ssrReplacer' 19 21 import { 20 22 deleteDefineConfig, 21 23 hijackVitePluginInject, 22 24 resolveFsAllow, 23 25 } from './utils' 24 - import { VitestOptimizer } from './optimizer' 25 - import { NormalizeURLPlugin } from './normalizeURL' 26 26 import { VitestCoreResolver } from './vitestResolver' 27 27 28 28 export async function VitestPlugin(
+1 -1
packages/vitest/src/node/plugins/normalizeURL.ts
··· 1 - import { stripLiteral } from 'strip-literal' 2 1 import type { Plugin } from 'vite' 2 + import { stripLiteral } from 'strip-literal' 3 3 4 4 const metaUrlLength = 'import.meta.url'.length 5 5 const locationString = 'self.location'.padEnd(metaUrlLength, ' ')
+1 -1
packages/vitest/src/node/plugins/ssrReplacer.ts
··· 1 - import MagicString from 'magic-string' 2 1 import type { Plugin } from 'vite' 2 + import MagicString from 'magic-string' 3 3 import { stripLiteral } from 'strip-literal' 4 4 import { cleanUrl } from 'vite-node/utils' 5 5
+3 -3
packages/vitest/src/node/plugins/utils.ts
··· 1 - import { searchForWorkspaceRoot, version as viteVersion } from 'vite' 2 1 import type { 3 2 DepOptimizationOptions, 4 3 ResolvedConfig, 5 4 UserConfig as ViteConfig, 6 5 } from 'vite' 7 - import { dirname } from 'pathe' 8 6 import type { DepsOptimizationOptions, InlineConfig } from '../types/config' 9 - import { VitestCache } from '../cache' 7 + import { dirname } from 'pathe' 8 + import { searchForWorkspaceRoot, version as viteVersion } from 'vite' 10 9 import { rootDir } from '../../paths' 10 + import { VitestCache } from '../cache' 11 11 12 12 export function resolveOptimizerConfig( 13 13 _testOptions: DepsOptimizationOptions | undefined,
+1 -1
packages/vitest/src/node/plugins/vitestResolver.ts
··· 1 1 import type { Plugin } from 'vite' 2 - import { join, resolve } from 'pathe' 3 2 import type { Vitest } from '../core' 3 + import { join, resolve } from 'pathe' 4 4 import { distDir } from '../../paths' 5 5 6 6 export function VitestProjectResolver(ctx: Vitest): Plugin {
+7 -7
packages/vitest/src/node/plugins/workspace.ts
··· 1 - import { existsSync, readFileSync } from 'node:fs' 2 - import { basename, dirname, relative, resolve } from 'pathe' 3 1 import type { UserConfig as ViteConfig, Plugin as VitePlugin } from 'vite' 2 + import type { ResolvedConfig, UserWorkspaceConfig } from '../types/config' 3 + import type { WorkspaceProject } from '../workspace' 4 + import { existsSync, readFileSync } from 'node:fs' 4 5 import { deepMerge } from '@vitest/utils' 6 + import { basename, dirname, relative, resolve } from 'pathe' 5 7 import { configDefaults } from '../../defaults' 6 8 import { generateScopedClassName } from '../../integrations/css/css-modules' 7 - import type { WorkspaceProject } from '../workspace' 8 - import type { ResolvedConfig, UserWorkspaceConfig } from '../types/config' 9 9 import { createViteLogger } from '../viteLogger' 10 10 import { CoverageTransform } from './coverageTransform' 11 11 import { CSSEnablerPlugin } from './cssEnabler' 12 - import { SsrReplacerPlugin } from './ssrReplacer' 13 12 import { MocksPlugins } from './mocks' 13 + import { NormalizeURLPlugin } from './normalizeURL' 14 + import { VitestOptimizer } from './optimizer' 15 + import { SsrReplacerPlugin } from './ssrReplacer' 14 16 import { 15 17 deleteDefineConfig, 16 18 hijackVitePluginInject, 17 19 resolveFsAllow, 18 20 } from './utils' 19 21 import { VitestProjectResolver } from './vitestResolver' 20 - import { VitestOptimizer } from './optimizer' 21 - import { NormalizeURLPlugin } from './normalizeURL' 22 22 23 23 interface WorkspaceOptions extends UserWorkspaceConfig { 24 24 root?: string
+12 -12
packages/vitest/src/node/pools/forks.ts
··· 1 - import v8 from 'node:v8' 2 - import * as nodeos from 'node:os' 3 - import EventEmitter from 'node:events' 4 - import { Tinypool } from 'tinypool' 5 1 import type { TinypoolChannel, Options as TinypoolOptions } from 'tinypool' 2 + import type { RunnerRPC, RuntimeRPC } from '../../types/rpc' 3 + import type { ContextRPC, ContextTestEnvironment } from '../../types/worker' 4 + import type { Vitest } from '../core' 5 + import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 6 + import type { SerializedConfig } from '../types/config' 7 + import type { WorkspaceProject } from '../workspace' 8 + import EventEmitter from 'node:events' 9 + import * as nodeos from 'node:os' 10 + import v8 from 'node:v8' 6 11 import { createBirpc } from 'birpc' 7 12 import { resolve } from 'pathe' 8 - import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 9 - import type { WorkspaceProject } from '../workspace' 10 - import { envsOrder, groupFilesByEnv } from '../../utils/test-helpers' 11 - import { wrapSerializableConfig } from '../../utils/config-helpers' 13 + import { Tinypool } from 'tinypool' 12 14 import { groupBy } from '../../utils/base' 13 - import type { SerializedConfig } from '../types/config' 14 - import type { RunnerRPC, RuntimeRPC } from '../../types/rpc' 15 - import type { Vitest } from '../core' 16 - import type { ContextRPC, ContextTestEnvironment } from '../../types/worker' 15 + import { wrapSerializableConfig } from '../../utils/config-helpers' 16 + import { envsOrder, groupFilesByEnv } from '../../utils/test-helpers' 17 17 import { createMethodsRPC } from './rpc' 18 18 19 19 function createChildProcessChannel(project: WorkspaceProject) {
+3 -3
packages/vitest/src/node/pools/rpc.ts
··· 1 - import { mkdir, writeFile } from 'node:fs/promises' 2 1 import type { RawSourceMap } from 'vite-node' 3 - import { join } from 'pathe' 4 - import type { WorkspaceProject } from '../workspace' 5 2 import type { RuntimeRPC } from '../../types/rpc' 3 + import type { WorkspaceProject } from '../workspace' 4 + import { mkdir, writeFile } from 'node:fs/promises' 5 + import { join } from 'pathe' 6 6 import { hash } from '../hash' 7 7 8 8 const created = new Set()
+10 -10
packages/vitest/src/node/pools/threads.ts
··· 1 - import { MessageChannel } from 'node:worker_threads' 2 - import * as nodeos from 'node:os' 3 - import { createBirpc } from 'birpc' 4 1 import type { Options as TinypoolOptions } from 'tinypool' 5 - import Tinypool from 'tinypool' 6 - import { resolve } from 'pathe' 7 - import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 8 - import { envsOrder, groupFilesByEnv } from '../../utils/test-helpers' 9 - import { groupBy } from '../../utils/base' 10 - import type { WorkspaceProject } from '../workspace' 11 - import type { SerializedConfig } from '../types/config' 12 2 import type { RunnerRPC, RuntimeRPC } from '../../types/rpc' 13 3 import type { ContextTestEnvironment } from '../../types/worker' 14 4 import type { Vitest } from '../core' 5 + import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 6 + import type { SerializedConfig } from '../types/config' 15 7 import type { WorkerContext } from '../types/worker' 8 + import type { WorkspaceProject } from '../workspace' 9 + import * as nodeos from 'node:os' 10 + import { MessageChannel } from 'node:worker_threads' 11 + import { createBirpc } from 'birpc' 12 + import { resolve } from 'pathe' 13 + import Tinypool from 'tinypool' 14 + import { groupBy } from '../../utils/base' 15 + import { envsOrder, groupFilesByEnv } from '../../utils/test-helpers' 16 16 import { createMethodsRPC } from './rpc' 17 17 18 18 function createWorkerChannel(project: WorkspaceProject) {
+4 -4
packages/vitest/src/node/pools/typecheck.ts
··· 1 1 import type { DeferPromise } from '@vitest/utils' 2 - import { createDefer } from '@vitest/utils' 3 - import { hasFailed } from '@vitest/runner/utils' 4 2 import type { TypecheckResults } from '../../typecheck/typechecker' 5 - import { Typechecker } from '../../typecheck/typechecker' 6 - import { groupBy } from '../../utils/base' 7 3 import type { Vitest } from '../core' 8 4 import type { ProcessPool, WorkspaceSpec } from '../pool' 9 5 import type { WorkspaceProject } from '../workspace' 6 + import { hasFailed } from '@vitest/runner/utils' 7 + import { createDefer } from '@vitest/utils' 8 + import { Typechecker } from '../../typecheck/typechecker' 9 + import { groupBy } from '../../utils/base' 10 10 11 11 export function createTypecheckPool(ctx: Vitest): ProcessPool { 12 12 const promisesMap = new WeakMap<WorkspaceProject, DeferPromise<void>>()
+10 -10
packages/vitest/src/node/pools/vmForks.ts
··· 1 + import type { TinypoolChannel, Options as TinypoolOptions } from 'tinypool' 2 + import type { RunnerRPC, RuntimeRPC } from '../../types/rpc' 3 + import type { ContextRPC, ContextTestEnvironment } from '../../types/worker' 4 + import type { Vitest } from '../core' 5 + import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 6 + import type { ResolvedConfig, SerializedConfig } from '../types/config' 7 + import type { WorkspaceProject } from '../workspace' 8 + import EventEmitter from 'node:events' 1 9 import * as nodeos from 'node:os' 2 10 import v8 from 'node:v8' 3 - import EventEmitter from 'node:events' 4 11 import { createBirpc } from 'birpc' 5 12 import { resolve } from 'pathe' 6 - import type { TinypoolChannel, Options as TinypoolOptions } from 'tinypool' 7 13 import Tinypool from 'tinypool' 8 14 import { rootDir } from '../../paths' 9 - import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 10 - import { groupFilesByEnv } from '../../utils/test-helpers' 11 - import type { WorkspaceProject } from '../workspace' 12 - import { getWorkerMemoryLimit, stringToBytes } from '../../utils/memory-limit' 13 15 import { wrapSerializableConfig } from '../../utils/config-helpers' 14 - import type { ResolvedConfig, SerializedConfig } from '../types/config' 15 - import type { RunnerRPC, RuntimeRPC } from '../../types/rpc' 16 - import type { Vitest } from '../core' 17 - import type { ContextRPC, ContextTestEnvironment } from '../../types/worker' 16 + import { getWorkerMemoryLimit, stringToBytes } from '../../utils/memory-limit' 17 + import { groupFilesByEnv } from '../../utils/test-helpers' 18 18 import { createMethodsRPC } from './rpc' 19 19 20 20 const suppressWarningsPath = resolve(rootDir, './suppress-warnings.cjs')
+11 -11
packages/vitest/src/node/pools/vmThreads.ts
··· 1 - import { MessageChannel } from 'node:worker_threads' 2 - import * as nodeos from 'node:os' 3 - import { createBirpc } from 'birpc' 4 - import { resolve } from 'pathe' 5 1 import type { Options as TinypoolOptions } from 'tinypool' 6 - import Tinypool from 'tinypool' 7 - import { rootDir } from '../../paths' 8 - import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 9 - import { groupFilesByEnv } from '../../utils/test-helpers' 10 - import type { WorkspaceProject } from '../workspace' 11 - import { getWorkerMemoryLimit, stringToBytes } from '../../utils/memory-limit' 12 - import type { ResolvedConfig, SerializedConfig } from '../types/config' 13 2 import type { RunnerRPC, RuntimeRPC } from '../../types/rpc' 14 3 import type { ContextTestEnvironment } from '../../types/worker' 15 4 import type { Vitest } from '../core' 5 + import type { PoolProcessOptions, ProcessPool, RunWithFiles } from '../pool' 6 + import type { ResolvedConfig, SerializedConfig } from '../types/config' 16 7 import type { WorkerContext } from '../types/worker' 8 + import type { WorkspaceProject } from '../workspace' 9 + import * as nodeos from 'node:os' 10 + import { MessageChannel } from 'node:worker_threads' 11 + import { createBirpc } from 'birpc' 12 + import { resolve } from 'pathe' 13 + import Tinypool from 'tinypool' 14 + import { rootDir } from '../../paths' 15 + import { getWorkerMemoryLimit, stringToBytes } from '../../utils/memory-limit' 16 + import { groupFilesByEnv } from '../../utils/test-helpers' 17 17 import { createMethodsRPC } from './rpc' 18 18 19 19 const suppressWarningsPath = resolve(rootDir, './suppress-warnings.cjs')
+8 -8
packages/vitest/src/node/reporters/base.ts
··· 1 - import { performance } from 'node:perf_hooks' 2 - import c from 'tinyrainbow' 3 - import { parseStacktrace } from '@vitest/utils/source-map' 4 - import { relative } from 'pathe' 5 1 import type { File, Task, TaskResultPack } from '@vitest/runner' 6 - import { toArray } from '@vitest/utils' 7 - import { getFullName, getSuites, getTestName, getTests, hasFailed } from '@vitest/runner/utils' 8 - import { isCI, isDeno, isNode } from '../../utils/env' 2 + import type { ErrorWithDiff, UserConsoleLog } from '../../types/general' 9 3 import type { Vitest } from '../core' 10 4 import type { Reporter } from '../types/reporter' 11 - import type { ErrorWithDiff, UserConsoleLog } from '../../types/general' 5 + import { performance } from 'node:perf_hooks' 6 + import { getFullName, getSuites, getTestName, getTests, hasFailed } from '@vitest/runner/utils' 7 + import { toArray } from '@vitest/utils' 8 + import { parseStacktrace } from '@vitest/utils/source-map' 9 + import { relative } from 'pathe' 10 + import c from 'tinyrainbow' 11 + import { isCI, isDeno, isNode } from '../../utils/env' 12 12 import { hasFailedSnapshot } from '../../utils/tasks' 13 13 import { F_CHECK, F_POINTER, F_RIGHT } from './renderers/figures' 14 14 import {
+5 -5
packages/vitest/src/node/reporters/blob.ts
··· 1 - import { mkdir, readFile, readdir, stat, writeFile } from 'node:fs/promises' 1 + import type { File } from '@vitest/runner' 2 + import type { Vitest } from '../core' 3 + import type { Reporter } from '../types/reporter' 4 + import type { WorkspaceProject } from '../workspace' 2 5 import { existsSync } from 'node:fs' 6 + import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises' 3 7 import { parse, stringify } from 'flatted' 4 8 import { dirname, resolve } from 'pathe' 5 - import type { File } from '@vitest/runner' 6 9 import { getOutputFile } from '../../utils/config-helpers' 7 - import type { WorkspaceProject } from '../workspace' 8 - import type { Reporter } from '../types/reporter' 9 - import type { Vitest } from '../core' 10 10 11 11 export interface BlobOptions { 12 12 outputFile?: string
+2 -2
packages/vitest/src/node/reporters/default.ts
··· 1 - import c from 'tinyrainbow' 2 1 import type { UserConsoleLog } from '../../types/general' 3 - import { BaseReporter } from './base' 4 2 import type { ListRendererOptions } from './renderers/listRenderer' 3 + import c from 'tinyrainbow' 4 + import { BaseReporter } from './base' 5 5 import { createListRenderer } from './renderers/listRenderer' 6 6 7 7 export class DefaultReporter extends BaseReporter {
+4 -4
packages/vitest/src/node/reporters/github-actions.ts
··· 1 + import type { File } from '@vitest/runner' 2 + import type { Vitest } from '../core' 3 + import type { Reporter } from '../types/reporter' 4 + import type { WorkspaceProject } from '../workspace' 1 5 import { stripVTControlCharacters } from 'node:util' 2 6 import { getFullName, getTasks } from '@vitest/runner/utils' 3 - import type { File } from '@vitest/runner' 4 7 import { capturePrintError } from '../error' 5 - import type { WorkspaceProject } from '../workspace' 6 - import type { Reporter } from '../types/reporter' 7 - import type { Vitest } from '../core' 8 8 9 9 export class GithubActionsReporter implements Reporter { 10 10 ctx: Vitest = undefined!
+1 -1
packages/vitest/src/node/reporters/hanging-process.ts
··· 1 - import { createRequire } from 'node:module' 2 1 import type { Reporter } from '../types/reporter' 2 + import { createRequire } from 'node:module' 3 3 4 4 export class HangingProcessReporter implements Reporter { 5 5 whyRunning: (() => void) | undefined
+35 -35
packages/vitest/src/node/reporters/index.ts
··· 1 1 import type { Reporter } from '../types/reporter' 2 + import type { BaseOptions, BaseReporter } from './base' 3 + import type { BlobOptions } from './blob' 4 + import type { HTMLOptions } from './html' 5 + import type { ModuleDiagnostic as _FileDiagnostic } from './reported-tasks' 2 6 import { BasicReporter } from './basic' 7 + import { BlobReporter } from './blob' 3 8 import { DefaultReporter } from './default' 4 9 import { DotReporter } from './dot' 5 - import { type JsonOptions, JsonReporter } from './json' 6 - import { VerboseReporter } from './verbose' 7 - import { TapReporter } from './tap' 8 - import { type JUnitOptions, JUnitReporter } from './junit' 9 - import { TapFlatReporter } from './tap-flat' 10 - import { HangingProcessReporter } from './hanging-process' 11 10 import { GithubActionsReporter } from './github-actions' 12 - import type { BaseOptions, BaseReporter } from './base' 13 - import type { HTMLOptions } from './html' 14 - import type { BlobOptions } from './blob' 15 - import { BlobReporter } from './blob' 11 + import { HangingProcessReporter } from './hanging-process' 12 + import { type JsonOptions, JsonReporter } from './json' 13 + import { type JUnitOptions, JUnitReporter } from './junit' 16 14 import { TestModule as _TestFile } from './reported-tasks' 17 - import type { ModuleDiagnostic as _FileDiagnostic } from './reported-tasks' 15 + import { TapReporter } from './tap' 16 + import { TapFlatReporter } from './tap-flat' 17 + import { VerboseReporter } from './verbose' 18 18 19 19 export { 20 - DefaultReporter, 21 20 BasicReporter, 21 + DefaultReporter, 22 22 DotReporter, 23 + GithubActionsReporter, 24 + HangingProcessReporter, 23 25 JsonReporter, 24 - VerboseReporter, 25 - TapReporter, 26 26 JUnitReporter, 27 27 TapFlatReporter, 28 - HangingProcessReporter, 29 - GithubActionsReporter, 28 + TapReporter, 29 + VerboseReporter, 30 30 } 31 31 export type { BaseReporter, Reporter } 32 32 33 - export { TestCase, TestModule, TestSuite } from './reported-tasks' 33 + export type { TestProject } from '../reported-workspace-project' 34 34 /** 35 35 * @deprecated Use `TestModule` instead 36 36 */ 37 37 export const TestFile = _TestFile 38 - export type { TestProject } from '../reported-workspace-project' 39 - export type { 40 - TestCollection, 41 - 42 - TaskOptions, 43 - TestDiagnostic, 44 - 45 - TestResult, 46 - TestResultFailed, 47 - TestResultPassed, 48 - TestResultSkipped, 49 - } from './reported-tasks' 50 - /** 51 - * @deprecated Use `ModuleDiagnostic` instead 52 - */ 53 - export type FileDiagnostic = _FileDiagnostic 54 - 38 + export * from './benchmark' 55 39 export type { 56 40 JsonAssertionResult, 57 41 JsonTestResult, 58 42 JsonTestResults, 59 43 } from './json' 44 + /** 45 + * @deprecated Use `ModuleDiagnostic` instead 46 + */ 47 + export type FileDiagnostic = _FileDiagnostic 48 + 49 + export { TestCase, TestModule, TestSuite } from './reported-tasks' 60 50 61 51 export const ReportersMap = { 62 52 'default': DefaultReporter, ··· 88 78 'html': HTMLOptions 89 79 } 90 80 91 - export * from './benchmark' 81 + export type { 82 + TaskOptions, 83 + 84 + TestCollection, 85 + TestDiagnostic, 86 + 87 + TestResult, 88 + TestResultFailed, 89 + TestResultPassed, 90 + TestResultSkipped, 91 + } from './reported-tasks'
+5 -5
packages/vitest/src/node/reporters/json.ts
··· 1 - import { existsSync, promises as fs } from 'node:fs' 2 - import { dirname, resolve } from 'pathe' 3 1 import type { File, Suite, TaskMeta, TaskState } from '@vitest/runner' 4 2 import type { SnapshotSummary } from '@vitest/snapshot' 5 - import { getSuites, getTests } from '@vitest/runner/utils' 6 - import { getOutputFile } from '../../utils/config-helpers' 7 - import type { Reporter } from '../types/reporter' 8 3 import type { Vitest } from '../core' 4 + import type { Reporter } from '../types/reporter' 5 + import { existsSync, promises as fs } from 'node:fs' 6 + import { getSuites, getTests } from '@vitest/runner/utils' 7 + import { dirname, resolve } from 'pathe' 8 + import { getOutputFile } from '../../utils/config-helpers' 9 9 10 10 // for compatibility reasons, the reporter produces a JSON similar to the one produced by the Jest JSON reporter 11 11 // the following types are extracted from the Jest repository (and simplified)
+6 -6
packages/vitest/src/node/reporters/junit.ts
··· 1 - import { existsSync, promises as fs } from 'node:fs' 2 - import { hostname } from 'node:os' 3 - import { stripVTControlCharacters } from 'node:util' 4 - import { dirname, relative, resolve } from 'pathe' 5 - 6 1 import type { Task } from '@vitest/runner' 7 - import { getSuites } from '@vitest/runner/utils' 8 2 import type { Vitest } from '../core' 9 3 import type { Reporter } from '../types/reporter' 4 + import { existsSync, promises as fs } from 'node:fs' 5 + 6 + import { hostname } from 'node:os' 7 + import { stripVTControlCharacters } from 'node:util' 8 + import { getSuites } from '@vitest/runner/utils' 9 + import { dirname, relative, resolve } from 'pathe' 10 10 import { getOutputFile } from '../../utils/config-helpers' 11 11 import { capturePrintError } from '../error' 12 12 import { IndentedLogger } from './renderers/indented-logger'
+3 -3
packages/vitest/src/node/reporters/utils.ts
··· 1 1 import type { ViteNodeRunner } from 'vite-node/client' 2 - import type { Reporter } from '../types/reporter' 3 - import type { ResolvedConfig } from '../types/config' 4 2 import type { Vitest } from '../core' 3 + import type { ResolvedConfig } from '../types/config' 4 + import type { Reporter } from '../types/reporter' 5 5 import type { BenchmarkBuiltinReporters, BuiltinReporters } from './index' 6 6 import { BenchmarkReportsMap, ReportersMap } from './index' 7 7 ··· 97 97 return Promise.all(promisedReporters) 98 98 } 99 99 100 - export { createReporters, createBenchmarkReporters } 100 + export { createBenchmarkReporters, createReporters }
+2 -2
packages/vitest/src/node/reporters/verbose.ts
··· 1 - import c from 'tinyrainbow' 2 1 import type { TaskResultPack } from '@vitest/runner' 3 2 import { getFullName } from '@vitest/runner/utils' 4 - import { F_RIGHT } from './renderers/figures' 3 + import c from 'tinyrainbow' 5 4 import { DefaultReporter } from './default' 5 + import { F_RIGHT } from './renderers/figures' 6 6 import { formatProjectName, getStateSymbol } from './renderers/utils' 7 7 8 8 export class VerboseReporter extends DefaultReporter {
+3 -3
packages/vitest/src/node/sequencers/BaseSequencer.ts
··· 1 - import { relative, resolve } from 'pathe' 2 - import { slash } from 'vite-node/utils' 3 - import { hash } from '../hash' 4 1 import type { Vitest } from '../core' 5 2 import type { WorkspaceSpec } from '../pool' 6 3 import type { TestSequencer } from './types' 4 + import { relative, resolve } from 'pathe' 5 + import { slash } from 'vite-node/utils' 6 + import { hash } from '../hash' 7 7 8 8 export class BaseSequencer implements TestSequencer { 9 9 protected ctx: Vitest
+1 -1
packages/vitest/src/node/sequencers/RandomSequencer.ts
··· 1 - import { shuffle } from '@vitest/utils' 2 1 import type { WorkspaceSpec } from '../pool' 2 + import { shuffle } from '@vitest/utils' 3 3 import { BaseSequencer } from './BaseSequencer' 4 4 5 5 export class RandomSequencer extends BaseSequencer {
+2 -2
packages/vitest/src/node/types/browser.ts
··· 1 - import type { Awaitable, ErrorWithDiff, ParsedStack } from '@vitest/utils' 2 - import type { ViteDevServer } from 'vite' 3 1 import type { CancelReason } from '@vitest/runner' 2 + import type { Awaitable, ErrorWithDiff, ParsedStack } from '@vitest/utils' 4 3 import type { StackTraceParserOptions } from '@vitest/utils/source-map' 4 + import type { ViteDevServer } from 'vite' 5 5 import type { WorkspaceProject } from '../workspace' 6 6 import type { ApiConfig } from './config' 7 7
+14 -14
packages/vitest/src/node/types/config.ts
··· 1 - import type { AliasOptions, ConfigEnv, DepOptimizationConfig, ServerOptions, UserConfig as ViteUserConfig } from 'vite' 2 - import type { PrettyFormatOptions } from '@vitest/pretty-format' 3 1 import type { FakeTimerInstallOpts } from '@sinonjs/fake-timers' 2 + import type { PrettyFormatOptions } from '@vitest/pretty-format' 4 3 import type { SequenceHooks, SequenceSetupFiles } from '@vitest/runner' 5 - import type { ViteNodeServerOptions } from 'vite-node' 6 4 import type { SnapshotStateOptions } from '@vitest/snapshot' 5 + import type { AliasOptions, ConfigEnv, DepOptimizationConfig, ServerOptions, UserConfig as ViteUserConfig } from 'vite' 6 + import type { ViteNodeServerOptions } from 'vite-node' 7 + import type { ChaiConfig } from '../../integrations/chai/config' 8 + import type { EnvironmentOptions } from '../../types/environment' 9 + import type { Arrayable, ErrorWithDiff, ParsedStack, ProvidedContext } from '../../types/general' 10 + import type { HappyDOMOptions } from '../../types/happy-dom-options' 11 + import type { JSDOMOptions } from '../../types/jsdom-options' 7 12 import type { 8 13 BuiltinReporterOptions, 9 14 BuiltinReporters, 10 15 } from '../reporters' 11 16 import type { TestSequencerConstructor } from '../sequencers/types' 12 - import type { ChaiConfig } from '../../integrations/chai/config' 13 - import type { Arrayable, ErrorWithDiff, ParsedStack, ProvidedContext } from '../../types/general' 14 - import type { JSDOMOptions } from '../../types/jsdom-options' 15 - import type { HappyDOMOptions } from '../../types/happy-dom-options' 16 - import type { EnvironmentOptions } from '../../types/environment' 17 + import type { BenchmarkUserOptions } from './benchmark' 18 + import type { BrowserConfigOptions, ResolvedBrowserOptions } from './browser' 17 19 import type { CoverageOptions, ResolvedCoverageOptions } from './coverage' 18 20 import type { Pool, PoolOptions, ResolvedPoolOptions } from './pool-options' 19 - import type { BrowserConfigOptions, ResolvedBrowserOptions } from './browser' 20 21 import type { Reporter } from './reporter' 21 - import type { BenchmarkUserOptions } from './benchmark' 22 22 23 23 export type { CoverageOptions, ResolvedCoverageOptions } 24 24 export type { BenchmarkUserOptions } 25 - export type { CoverageV8Options, CoverageIstanbulOptions } from './coverage' 26 - export type { BrowserScript, BrowserConfigOptions } from './browser' 25 + export type { RuntimeConfig, SerializedConfig } from '../../runtime/config' 26 + export type { BrowserConfigOptions, BrowserScript } from './browser' 27 + export type { CoverageIstanbulOptions, CoverageV8Options } from './coverage' 27 28 export type { SequenceHooks, SequenceSetupFiles } from '@vitest/runner' 28 - export type { SerializedConfig, RuntimeConfig } from '../../runtime/config' 29 29 30 30 export type BuiltinEnvironment = 31 31 | 'node' ··· 44 44 'port' | 'strictPort' | 'host' | 'middlewareMode' 45 45 > 46 46 47 - export type { JSDOMOptions, HappyDOMOptions, EnvironmentOptions } 47 + export type { EnvironmentOptions, HappyDOMOptions, JSDOMOptions } 48 48 49 49 export type VitestRunMode = 'test' | 'benchmark' 50 50
+1 -1
packages/vitest/src/node/types/coverage.ts
··· 1 - import type { TransformResult as ViteTransformResult } from 'vite' 2 1 import type { ReportOptions } from 'istanbul-reports' 2 + import type { TransformResult as ViteTransformResult } from 'vite' 3 3 import type { AfterSuiteRunMeta, Arrayable } from '../../types/general' 4 4 import type { Vitest } from '../core' 5 5
+1 -1
packages/vitest/src/node/types/reporter.ts
··· 1 1 import type { File, TaskResultPack } from '@vitest/runner' 2 - import type { Vitest } from '../core' 3 2 import type { SerializedTestSpecification } from '../../runtime/types/utils' 4 3 import type { Awaitable, UserConsoleLog } from '../../types/general' 4 + import type { Vitest } from '../core' 5 5 6 6 export interface Reporter { 7 7 onInit?: (ctx: Vitest) => void
+6 -6
packages/vitest/src/node/workspace/resolveWorkspace.ts
··· 1 - import { existsSync, promises as fs } from 'node:fs' 2 - import { isMainThread } from 'node:worker_threads' 3 - import { dirname, relative, resolve } from 'pathe' 4 - import fg from 'fast-glob' 5 - import { mergeConfig } from 'vite' 6 1 import type { Vitest } from '../core' 7 2 import type { UserConfig, UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../types/config' 8 3 import type { WorkspaceProject } from '../workspace' 9 - import { initializeProject } from '../workspace' 4 + import { existsSync, promises as fs } from 'node:fs' 5 + import { isMainThread } from 'node:worker_threads' 6 + import fg from 'fast-glob' 7 + import { dirname, relative, resolve } from 'pathe' 8 + import { mergeConfig } from 'vite' 10 9 import { configFiles as defaultConfigFiles } from '../../constants' 10 + import { initializeProject } from '../workspace' 11 11 import { isDynamicPattern } from './fast-glob-pattern' 12 12 13 13 export async function resolveWorkspace(
+7 -7
packages/vitest/src/runtime/runners/benchmark.ts
··· 4 4 VitestRunner, 5 5 VitestRunnerImportSource, 6 6 } from '@vitest/runner' 7 + import type { SerializedConfig } from '../config' 8 + import type { VitestExecutor } from '../execute' 9 + import type { 10 + Benchmark, 11 + BenchmarkResult, 12 + BenchTask, 13 + } from '../types/benchmark' 7 14 import { updateTask as updateRunnerTask } from '@vitest/runner' 8 15 import { createDefer, getSafeTimers } from '@vitest/utils' 9 16 import { getBenchFn, getBenchOptions } from '../benchmark' 10 17 import { getWorkerState } from '../utils' 11 - import type { 12 - BenchTask, 13 - Benchmark, 14 - BenchmarkResult, 15 - } from '../types/benchmark' 16 - import type { SerializedConfig } from '../config' 17 - import type { VitestExecutor } from '../execute' 18 18 19 19 function createBenchmarkResult(name: string): BenchmarkResult { 20 20 return {
+7 -7
packages/vitest/src/runtime/runners/index.ts
··· 1 1 import type { VitestRunner, VitestRunnerConstructor } from '@vitest/runner' 2 - import { resolve } from 'pathe' 3 - import type { VitestExecutor } from '../execute' 4 - import { distDir } from '../../paths' 5 - import { getWorkerState } from '../utils' 6 - import { rpc } from '../rpc' 7 - import { takeCoverageInsideWorker } from '../../integrations/coverage' 8 - import { loadDiffConfig, loadSnapshotSerializers } from '../setup-common' 9 2 import type { SerializedConfig } from '../config' 3 + import type { VitestExecutor } from '../execute' 4 + import { resolve } from 'pathe' 5 + import { takeCoverageInsideWorker } from '../../integrations/coverage' 6 + import { distDir } from '../../paths' 7 + import { rpc } from '../rpc' 8 + import { loadDiffConfig, loadSnapshotSerializers } from '../setup-common' 9 + import { getWorkerState } from '../utils' 10 10 11 11 const runnersFile = resolve(distDir, 'runners.js') 12 12
+6 -6
packages/vitest/src/runtime/runners/test.ts
··· 1 + import type { ExpectStatic } from '@vitest/expect' 1 2 import type { 2 3 CancelReason, 3 4 Custom, ··· 10 11 VitestRunner, 11 12 VitestRunnerImportSource, 12 13 } from '@vitest/runner' 13 - import type { ExpectStatic } from '@vitest/expect' 14 - import { GLOBAL_EXPECT, getState, setState } from '@vitest/expect' 15 - import { getNames, getTestName, getTests } from '@vitest/runner/utils' 16 - import { getSnapshotClient } from '../../integrations/snapshot/chai' 17 - import { vi } from '../../integrations/vi' 18 - import { createExpect } from '../../integrations/chai/index' 19 14 import type { SerializedConfig } from '../config' 20 15 import type { VitestExecutor } from '../execute' 16 + import { getState, GLOBAL_EXPECT, setState } from '@vitest/expect' 17 + import { getNames, getTestName, getTests } from '@vitest/runner/utils' 18 + import { createExpect } from '../../integrations/chai/index' 19 + import { getSnapshotClient } from '../../integrations/snapshot/chai' 20 + import { vi } from '../../integrations/vi' 21 21 import { rpc } from '../rpc' 22 22 import { getWorkerState } from '../utils' 23 23
+1 -1
packages/vitest/src/runtime/types/benchmark.ts
··· 32 32 runIf: (condition: any) => ChainableBenchmarkAPI 33 33 } 34 34 35 - export { BenchTaskResult, BenchOptions, BenchFactory, BenchTask } 35 + export { BenchFactory, BenchOptions, BenchTask, BenchTaskResult }
+3 -3
packages/vitest/src/runtime/vm/commonjs-executor.ts
··· 1 - import vm from 'node:vm' 1 + import type { FileMap } from './file-map' 2 + import type { ImportModuleDynamically, VMModule } from './types' 2 3 import { Module as _Module, createRequire } from 'node:module' 4 + import vm from 'node:vm' 3 5 import { basename, dirname, extname } from 'pathe' 4 6 import { isNodeBuiltin } from 'vite-node/utils' 5 - import type { ImportModuleDynamically, VMModule } from './types' 6 - import type { FileMap } from './file-map' 7 7 8 8 interface CommonjsExecutorOptions { 9 9 fileMap: FileMap
+2 -2
packages/vitest/src/runtime/vm/esm-executor.ts
··· 1 1 import type vm from 'node:vm' 2 - import { fileURLToPath } from 'node:url' 3 - import { dirname } from 'node:path' 4 2 import type { ExternalModulesExecutor } from '../external-executor' 5 3 import type { VMModule } from './types' 4 + import { dirname } from 'node:path' 5 + import { fileURLToPath } from 'node:url' 6 6 import { SourceTextModule, SyntheticModule } from './utils' 7 7 8 8 interface EsmExecutorOptions {
+1 -1
packages/vitest/src/runtime/vm/utils.ts
··· 1 + import type { VMSourceTextModule, VMSyntheticModule } from './types' 1 2 import vm from 'node:vm' 2 3 import { isPrimitive } from 'vite-node/utils' 3 - import type { VMSourceTextModule, VMSyntheticModule } from './types' 4 4 5 5 export function interopCommonJsModule( 6 6 interopDefault: boolean | undefined,
+3 -3
packages/vitest/src/runtime/vm/vite-executor.ts
··· 1 1 import type vm from 'node:vm' 2 + import type { RuntimeRPC } from '../../types/rpc' 3 + import type { WorkerGlobalState } from '../../types/worker' 4 + import type { EsmExecutor } from './esm-executor' 2 5 import { pathToFileURL } from 'node:url' 3 6 import { normalize } from 'pathe' 4 7 import { CSS_LANGS_RE, KNOWN_ASSET_RE } from 'vite-node/constants' 5 8 import { toArray } from 'vite-node/utils' 6 - import type { RuntimeRPC } from '../../types/rpc' 7 - import type { WorkerGlobalState } from '../../types/worker' 8 - import type { EsmExecutor } from './esm-executor' 9 9 import { SyntheticModule } from './utils' 10 10 11 11 interface ViteExecutorOptions {
+2 -2
packages/vitest/src/runtime/workers/base.ts
··· 1 - import { ModuleCacheMap } from 'vite-node/client' 2 1 import type { WorkerGlobalState } from '../../types/worker' 3 - import { provideWorkerState } from '../utils' 4 2 import type { ContextExecutorOptions, VitestExecutor } from '../execute' 3 + import { ModuleCacheMap } from 'vite-node/client' 5 4 import { getDefaultRequestStubs, startVitestExecutor } from '../execute' 5 + import { provideWorkerState } from '../utils' 6 6 7 7 let _viteNode: VitestExecutor 8 8
+3 -3
packages/vitest/src/runtime/workers/forks.ts
··· 1 - import v8 from 'node:v8' 2 1 import type { WorkerGlobalState } from '../../types/worker' 3 - import { createForksRpcOptions, unwrapSerializableConfig } from './utils' 4 - import { runBaseTests } from './base' 5 2 import type { VitestWorker } from './types' 3 + import v8 from 'node:v8' 4 + import { runBaseTests } from './base' 5 + import { createForksRpcOptions, unwrapSerializableConfig } from './utils' 6 6 7 7 class ForksBaseWorker implements VitestWorker { 8 8 getRpcOptions() {
+1 -1
packages/vitest/src/runtime/workers/threads.ts
··· 1 1 import type { WorkerContext } from '../../node/types/worker' 2 2 import type { ContextRPC, WorkerGlobalState } from '../../types/worker' 3 - import { runBaseTests } from './base' 4 3 import type { VitestWorker } from './types' 4 + import { runBaseTests } from './base' 5 5 import { createThreadsRpcOptions } from './utils' 6 6 7 7 class ThreadsBaseWorker implements VitestWorker {
+1 -1
packages/vitest/src/runtime/workers/types.ts
··· 1 - import type { BirpcOptions } from 'birpc' 2 1 import type { Awaitable } from '@vitest/utils' 2 + import type { BirpcOptions } from 'birpc' 3 3 import type { RuntimeRPC } from '../../types/rpc' 4 4 import type { ContextRPC, WorkerGlobalState } from '../../types/worker' 5 5
+1 -1
packages/vitest/src/runtime/workers/utils.ts
··· 1 1 import type { TinypoolWorkerMessage } from 'tinypool' 2 - import { parseRegexp } from '@vitest/utils' 3 2 import type { ResolvedConfig, SerializedConfig } from '../../node/types/config' 4 3 import type { WorkerContext } from '../../node/types/worker' 5 4 import type { WorkerRpcOptions } from './types' 5 + import { parseRegexp } from '@vitest/utils' 6 6 7 7 const REGEXP_WRAP_PREFIX = '$$vitest:' 8 8
+5 -5
packages/vitest/src/runtime/workers/vm.ts
··· 1 1 import type { Context } from 'node:vm' 2 - import { isContext } from 'node:vm' 3 - import { pathToFileURL } from 'node:url' 4 - import { resolve } from 'pathe' 5 2 import type { WorkerGlobalState } from '../../types/worker' 3 + import { pathToFileURL } from 'node:url' 4 + import { isContext } from 'node:vm' 5 + import { resolve } from 'pathe' 6 + import { distDir } from '../../paths' 6 7 import { createCustomConsole } from '../console' 7 8 import { getDefaultRequestStubs, startVitestExecutor } from '../execute' 8 - import { distDir } from '../../paths' 9 9 import { ExternalModulesExecutor } from '../external-executor' 10 - import { FileMap } from '../vm/file-map' 11 10 import { provideWorkerState } from '../utils' 11 + import { FileMap } from '../vm/file-map' 12 12 13 13 const entryFile = pathToFileURL(resolve(distDir, 'workers/runVmTests.js')).href 14 14
+2 -2
packages/vitest/src/runtime/workers/vmForks.ts
··· 1 - import v8 from 'node:v8' 2 1 import type { WorkerGlobalState } from '../../types/worker' 3 - import { createForksRpcOptions, unwrapSerializableConfig } from './utils' 4 2 import type { VitestWorker } from './types' 3 + import v8 from 'node:v8' 4 + import { createForksRpcOptions, unwrapSerializableConfig } from './utils' 5 5 import { runVmTests } from './vm' 6 6 7 7 class ForksVmWorker implements VitestWorker {
+1 -1
test/core/__mocks__/@vueuse/integrations/useJwt.ts
··· 1 - import { ref } from 'vue' 2 1 import { vi } from 'vitest' 2 + import { ref } from 'vue' 3 3 4 4 export const useJwt = vi.fn(() => ({ 5 5 payload: ref({
+5 -5
packages/browser/src/client/tester/locators/index.ts
··· 1 + import type { BrowserRPC } from '@vitest/browser/client' 1 2 import type { 2 3 LocatorByRoleOptions, 3 4 LocatorOptions, ··· 7 8 UserEventFillOptions, 8 9 UserEventHoverOptions, 9 10 } from '@vitest/browser/context' 11 + import type { WorkerGlobalState } from 'vitest' 12 + import type { BrowserRunnerState } from '../../utils' 10 13 import { page, server } from '@vitest/browser/context' 11 - import type { BrowserRPC } from '@vitest/browser/client' 12 14 import { 13 - Ivya, 14 - type ParsedSelector, 15 15 getByAltTextSelector, 16 16 getByLabelSelector, 17 17 getByPlaceholderSelector, ··· 19 19 getByTestIdSelector, 20 20 getByTextSelector, 21 21 getByTitleSelector, 22 + Ivya, 23 + type ParsedSelector, 22 24 } from 'ivya' 23 - import type { WorkerGlobalState } from 'vitest' 24 - import type { BrowserRunnerState } from '../../utils' 25 25 import { getBrowserState, getWorkerState } from '../../utils' 26 26 import { getElementError } from '../public-utils' 27 27
+1 -1
packages/browser/src/client/tester/locators/preview.ts
··· 1 - import { page, server } from '@vitest/browser/context' 2 1 import { userEvent } from '@testing-library/user-event' 2 + import { page, server } from '@vitest/browser/context' 3 3 import { 4 4 getByAltTextSelector, 5 5 getByLabelSelector,
+1 -1
packages/vitest/src/integrations/snapshot/environments/resolveSnapshotEnvironment.ts
··· 1 1 import type { SnapshotEnvironment } from '@vitest/snapshot/environment' 2 - import type { VitestExecutor } from '../../../runtime/execute' 3 2 import type { SerializedConfig } from '../../../runtime/config' 3 + import type { VitestExecutor } from '../../../runtime/execute' 4 4 5 5 export async function resolveSnapshotEnvironment( 6 6 config: SerializedConfig,
+2 -2
packages/vitest/src/node/reporters/renderers/dotRenderer.ts
··· 1 - import c from 'tinyrainbow' 2 1 import type { Task } from '@vitest/runner' 3 - import { getTests } from '@vitest/runner/utils' 4 2 import type { Logger } from '../../logger' 3 + import { getTests } from '@vitest/runner/utils' 4 + import c from 'tinyrainbow' 5 5 6 6 export interface DotRendererOptions { 7 7 logger: Logger
+6 -6
packages/vitest/src/node/reporters/renderers/listRenderer.ts
··· 1 - import { stripVTControlCharacters } from 'node:util' 2 - import c from 'tinyrainbow' 3 - import cliTruncate from 'cli-truncate' 4 1 import type { SuiteHooks, Task } from '@vitest/runner' 5 - import { getTests } from '@vitest/runner/utils' 6 - import { notNullish } from '@vitest/utils' 2 + import type { Benchmark, BenchmarkResult } from '../../../runtime/types/benchmark' 7 3 import type { Logger } from '../../logger' 8 4 import type { VitestRunMode } from '../../types/config' 9 - import type { Benchmark, BenchmarkResult } from '../../../runtime/types/benchmark' 5 + import { stripVTControlCharacters } from 'node:util' 6 + import { getTests } from '@vitest/runner/utils' 7 + import { notNullish } from '@vitest/utils' 8 + import cliTruncate from 'cli-truncate' 9 + import c from 'tinyrainbow' 10 10 import { F_RIGHT } from './figures' 11 11 import { 12 12 formatProjectName,
+3 -3
packages/vitest/src/node/reporters/renderers/utils.ts
··· 1 - import { stripVTControlCharacters } from 'node:util' 2 - import { basename, dirname, isAbsolute, relative } from 'pathe' 3 - import c from 'tinyrainbow' 4 1 import type { SuiteHooks, Task } from '@vitest/runner' 5 2 import type { SnapshotSummary } from '@vitest/snapshot' 3 + import { stripVTControlCharacters } from 'node:util' 6 4 import { slash } from '@vitest/utils' 5 + import { basename, dirname, isAbsolute, relative } from 'pathe' 6 + import c from 'tinyrainbow' 7 7 import { 8 8 F_CHECK, 9 9 F_CROSS,
+6 -6
packages/vitest/src/node/reporters/benchmark/table/index.ts
··· 1 - import fs from 'node:fs' 2 - import c from 'tinyrainbow' 3 - import * as pathe from 'pathe' 4 1 import type { File, TaskResultPack } from '@vitest/runner' 5 - import { getFullName, getTasks } from '@vitest/runner/utils' 2 + import type { BenchmarkResult } from '../../../../runtime/types/benchmark' 6 3 import type { UserConsoleLog } from '../../../../types/general' 4 + import fs from 'node:fs' 5 + import { getFullName, getTasks } from '@vitest/runner/utils' 6 + import * as pathe from 'pathe' 7 + import c from 'tinyrainbow' 7 8 import { BaseReporter } from '../../base' 8 9 import { getStateSymbol } from '../../renderers/utils' 9 - import type { BenchmarkResult } from '../../../../runtime/types/benchmark' 10 10 import { 11 - type TableRendererOptions, 12 11 createTableRenderer, 13 12 renderTree, 13 + type TableRendererOptions, 14 14 } from './tableRender' 15 15 16 16 export class TableReporter extends BaseReporter {
+9 -9
packages/vitest/src/node/reporters/benchmark/table/tableRender.ts
··· 1 - import { stripVTControlCharacters } from 'node:util' 2 - import c from 'tinyrainbow' 3 - import cliTruncate from 'cli-truncate' 4 1 import type { Task } from '@vitest/runner' 5 - import { notNullish } from '@vitest/utils' 6 - import { getTests } from '@vitest/runner/utils' 7 - import type { Logger } from '../../../logger' 8 - import { getCols, getStateSymbol } from '../../renderers/utils' 9 - import type { BenchmarkResult } from '../../../../runtime/types/benchmark' 10 - import { F_RIGHT } from '../../renderers/figures' 11 2 import type { FlatBenchmarkReport } from '.' 3 + import type { BenchmarkResult } from '../../../../runtime/types/benchmark' 4 + import type { Logger } from '../../../logger' 5 + import { stripVTControlCharacters } from 'node:util' 6 + import { getTests } from '@vitest/runner/utils' 7 + import { notNullish } from '@vitest/utils' 8 + import cliTruncate from 'cli-truncate' 9 + import c from 'tinyrainbow' 10 + import { F_RIGHT } from '../../renderers/figures' 11 + import { getCols, getStateSymbol } from '../../renderers/utils' 12 12 13 13 export interface TableRendererOptions { 14 14 renderSucceed?: boolean