npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@actview/testing

v0.1.1

Published

Readme

@actview/testing

ActView 组件测试工具(对齐 testing-library,TSX 风格)。配合 vitest + happy-dom 使用。

安装

pnpm add -D @actview/testing

快速开始

import { render, fireEvent, waitFor, screen, cleanup } from '@actview/testing'
import { reactive } from 'actview'

afterEach(cleanup)

function Counter() {
  const state = reactive({ count: 0 })
  return (
    <button class="btn" onClick={() => state.count++}>
      count: {state.count}
    </button>
  )
}

it('点击按钮计数 +1', async () => {
  const { getByClass, getByText } = render(() => <Counter />)
  expect(getByText('count: 0')).not.toBeNull()

  fireEvent(getByClass('btn'), 'click')
  await waitFor(() => expect(getByText('count: 1')).not.toBeNull())
})

API

| 导出 | 说明 | |---|---| | render(component, options?) | 挂载组件,返回容器 + 查询辅助 | | fireEvent(el, event, options?) | 触发 DOM 事件(value 选项设置 input 值) | | waitFor(cb, options?) | 轮询执行断言直到通过或超时 | | screen | 全局查询(作用于最近 render 的 container) | | cleanup() | 卸载全部 render 的组件 |

查询辅助

| 方法 | 说明 | |---|---| | getByText / queryByText | 文本匹配(get 找不到抛错,query 返回 null) | | getAllByText / queryAllByText | 全部文本匹配 | | getByClass / queryByClass | class 选择器 | | getByTestId / queryByTestId | data-testid 属性 |