Skip to content

Commit

Permalink
Merge branch 'vitest-dev:main' into fix/rerun-setup-files
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryven committed Jan 16, 2023
2 parents 57b8876 + 8b50123 commit 3b13c51
Show file tree
Hide file tree
Showing 78 changed files with 3,770 additions and 2,859 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -81,6 +81,14 @@ $ npx vitest
</a>
</p>

### Vladimir Sponsors

<p align="center">
<a href="https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg'/>
</a>
</p>

### Patak Sponsors

<p align="center">
Expand Down
14 changes: 14 additions & 0 deletions docs/.vitepress/components/HomePage.vue
Expand Up @@ -41,6 +41,20 @@ import { teamMembers } from '../contributors'
>
</a>
</div>
<div class="flex flex-col">
<a text-lg h="32px" href="https://github.com/sponsors/sheremet-va" rel="noopener noreferrer">Vladimir's Sponsors</a>
<a href="https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg" target="_blank" rel="noopener noreferrer">
<img
crossorigin="anonymous"
inline-block
width="768" height="1464"
class="resizable-img"
loading="lazy"
src="/sponsors/sheremet-va.svg"
alt="Vladimir's sponsors"
>
</a>
</div>
<div class="flex flex-col">
<a text-lg h="32px" href="https://github.com/sponsors/patak-dev" rel="noopener noreferrer">Patak's Sponsors</a>
<a href="https://cdn.jsdelivr.net/gh/patak-dev/static/sponsors.svg" target="_blank" rel="noopener noreferrer">
Expand Down
22 changes: 21 additions & 1 deletion docs/.vitepress/config.ts
Expand Up @@ -181,9 +181,29 @@ export default defineConfig({
text: 'API',
items: [
{
text: 'API Reference',
text: 'Test API Reference',
link: '/api/',
},
{
text: 'Mock Functions',
link: '/api/mock',
},
{
text: 'Vi Utility',
link: '/api/vi',
},
{
text: 'Expect',
link: '/api/expect',
},
{
text: 'ExpectTypeOf',
link: '/api/expect-typeof',
},
{
text: 'assertType',
link: '/api/assert-type',
},
],
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/scripts/fetch-avatars.ts
Expand Up @@ -32,6 +32,7 @@ async function fetchSponsors() {
await fs.ensureDir(dirSponsors)
await download('https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg', join(dirSponsors, 'antfu.svg'))
await download('https://cdn.jsdelivr.net/gh/patak-dev/static/sponsors.svg', join(dirSponsors, 'patak-dev.svg'))
await download('https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg', join(dirSponsors, 'sheremet-va.svg'))
}

fetchAvatars()
Expand Down
18 changes: 18 additions & 0 deletions docs/api/assert-type.md
@@ -0,0 +1,18 @@
# assertType

- **Type:** `<T>(value: T): void`

You can use this function as an alternative for [`expectTypeOf`](/api/expect-typeof) to easily assert that the argument type is equal to the generic provided.

```ts
import { assertType } from 'vitest'

function concat(a: string, b: string): string
function concat(a: number, b: number): number
function concat(a: string | number, b: string | number): string | number

assertType<string>(concat('a', 'b'))
assertType<number>(concat(1, 2))
// @ts-expect-error wrong types
assertType(concat('a', 2))
```

0 comments on commit 3b13c51

Please sign in to comment.