Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@japa/expect-type

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@japa/expect-type

Write assertions for TypeScript types

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

@japa/expect-type

Write assertions for TypeScript types

gh-workflow-image npm-image license-image

The expect-type plugin of Japa helps you write assertions against the TypeScript types. There is no runtime behavior with the expect-type plugin and you need to compile your code to view the assertion errors.

The plugins wraps expect-type under the hood.

Complete API documentation

Installation

Install the package from the npm registry as follows:

npm i @japa/expect-type

yarn add @japa/expect-type

Usage

You can use this package with the @japa/runner as follows.

import { expectTypeOf } from '@japa/expect-type'
import { configure } from '@japa/runner'

configure({
  plugins: [expectTypeOf()]
})

Once done, you will be able to access the expectTypeOf property on the test context.

test('test title', ({ expectTypeOf }) => {
  expectTypeOf({ foo: 'bar' }).toEqualTypeOf<{ foo: string }>()
})

FAQs

Package last updated on 02 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc