https://github.com/jcf/astro-vitest
Minimal reproduction of invalid types when following Astro's docs.
https://github.com/jcf/astro-vitest
Last synced: 3 months ago
JSON representation
Minimal reproduction of invalid types when following Astro's docs.
- Host: GitHub
- URL: https://github.com/jcf/astro-vitest
- Owner: jcf
- Created: 2025-08-06T21:19:34.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-08-06T21:30:19.000Z (5 months ago)
- Last Synced: 2025-08-06T23:31:06.198Z (5 months ago)
- Language: Shell
- Size: 57.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+title: Astro Vitest
The [[https://docs.astro.build/en/guides/testing/][testing docs]] of Astro mention use of =vitest=, providing the following
example configuration:
#+begin_src typescript
///
import { getViteConfig } from 'astro/config';
export default getViteConfig({
test: {
// Vitest configuration options
},
});
#+end_src
Unfortunately, that configuration fails to type-check.
#+begin_src sh :results output verbatim
tsc --noEmit 2>&1
#+end_src
#+results:
: vitest.config.ts(5,3): error TS2353: Object literal may only specify known properties, and 'test' does not exist in type 'UserConfig'.
* Dependencies
#+begin_src sh :results output verbatim :exports both
pnpm list
#+end_src
#+results:
#+begin_example
Legend: production dependency, optional only, dev only
astro-vitest@0.0.1 /Users/jcf/code/astro-vitest (PRIVATE)
dependencies:
astro 5.12.8
devDependencies:
@astrojs/check 0.9.4
typescript 5.9.2
typescript-language-server 4.4.0
vitest 3.2.4
#+end_example
#+begin_src sh :results output verbatim :exports both
pnpm why vite
#+end_src
#+results:
#+begin_example
Legend: production dependency, optional only, dev only
astro-vitest@0.0.1 /Users/jcf/code/astro-vitest (PRIVATE)
dependencies:
astro 5.12.8
├── vite 6.0.2
└─┬ vitefu 1.1.1
└── vite 6.0.2 peer
devDependencies:
vitest 3.2.4
├─┬ @vitest/mocker 3.2.4
│ └── vite 6.0.2 peer
├── vite 6.0.2
└─┬ vite-node 3.2.4
└── vite 6.0.2
#+end_example