Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 551 Bytes

testing-types.md

File metadata and controls

28 lines (21 loc) · 551 Bytes
title
Testing Types | Guide

Testing Types

Vitest allows you to write tests for your types.

Under the hood Vitest calls tsc or vue-tsc, depending on your config, and parses results.

// TODO write normal tests examples
import { describe, expectTypeOf, test } from 'vitest'

describe('test', () => {
  test('some-test', () => {
    expectTypeOf(45).toBe(45)
  })

  describe('test2', () => {
    test('some-test 2', () => {
      expectTypeOf(45).toBe(45)
    })
  })
})

expectTypeOf({ wolk: 'true' }).toHaveProperty('wolk')