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

@birhaus/test-utils

v3.0.0

Published

BIRHAUS v3.0 Radical Minimalist Testing Framework - Glass morphism validators, generous spacing tests, and v3 component validation utilities

Downloads

6

Readme

@birhaus/test-utils

BIRHAUS-specific testing utilities for validating design system compliance and accessibility.

Installation

npm install --save-dev @birhaus/test-utils

Testing Utilities

BIRHAUS Compliance Validation

import { expectBirhausCompliance } from '@birhaus/test-utils'

test('button follows BIRHAUS principles', async () => {
  render(<BirhausButton labelEs="Guardar" labelEn="Save" />)
  await expectBirhausCompliance(screen.getByRole('button'))
})

Miller's Law Validation

Ensure components don't exceed cognitive load limits (7±2 items).

import { expectMillersLawCompliance } from '@birhaus/test-utils'

test('navigation respects Miller\'s Law', async () => {
  render(<Navigation items={navigationItems} />)
  await expectMillersLawCompliance(container, { maxItems: 7 })
})

Spanish-first Testing

Validate bilingual labeling patterns.

import { expectSpanishFirstLabeling } from '@birhaus/test-utils'

test('component has Spanish-first labels', async () => {
  render(<BirhausCard titleEs="Título" titleEn="Title" />)
  await expectSpanishFirstLabeling(container)
})

Accessibility Validation

import { expectAccessibilityCompliance } from '@birhaus/test-utils'

test('component meets WCAG AA+ standards', async () => {
  render(<BirhausInput labelEs="Nombre" />)
  await expectAccessibilityCompliance(container, { level: 'AA' })
})

Undo Pattern Testing

import { expectUndoPatternCompliance } from '@birhaus/test-utils'

test('destructive action supports undo', async () => {
  render(<DeleteButton undoConfig={{...}} />)
  await expectUndoPatternCompliance(container)
})

Performance Testing

Cognitive Load Metrics

import { measureCognitiveLoad } from '@birhaus/test-utils'

test('interface has acceptable cognitive load', () => {
  const metrics = measureCognitiveLoad(container)
  expect(metrics.totalElements).toBeLessThan(9) // Miller's Law
  expect(metrics.primaryActions).toBeLessThan(4) // 4-3-1 rule
})

Performance Benchmarks

import { expectPerformanceCompliance } from '@birhaus/test-utils'

test('component meets performance thresholds', async () => {
  const { container } = render(<BirhausDataTable data={largeDataset} />)
  await expectPerformanceCompliance(container, {
    renderTime: 100, // ms
    memoryUsage: 50  // MB
  })
})

Mock Data Generators

Generate BIRHAUS-compliant test data:

import { 
  generateMockFinancialData,
  generateMockUserData,
  generateMockTransactionHistory 
} from '@birhaus/test-utils'

const mockDonations = generateMockFinancialData(50)
const mockMembers = generateMockUserData(25)

Testing Presets

Common testing configurations:

import { birhausTestingPresets } from '@birhaus/test-utils'

// Financial application testing
const financialTests = birhausTestingPresets.financial({
  currency: 'PYG',
  locale: 'es-PY'
})

// Educational platform testing  
const educationTests = birhausTestingPresets.education({
  studentRoles: ['student', 'teacher', 'admin']
})

Integration

Works with popular testing frameworks:

  • Vitest (recommended)
  • Jest
  • React Testing Library
  • Playwright (for E2E testing)

Setup Example

// vitest.config.ts
import { defineConfig } from 'vitest/config'
import { birhausTestConfig } from '@birhaus/test-utils'

export default defineConfig({
  ...birhausTestConfig,
  test: {
    setupFiles: ['@birhaus/test-utils/setup']
  }
})

Custom Matchers

Additional Jest/Vitest matchers:

expect(element).toHaveSpanishFirstLabel()
expect(component).toRespectMillersLaw()
expect(action).toHaveUndoPattern()
expect(interface).toBeBirhausCompliant()

CI/CD Integration

Use in GitHub Actions:

- name: BIRHAUS Compliance Tests
  run: |
    npm run test:birhaus
    npm run test:accessibility
    npm run test:performance

License

MIT - see LICENSE for details.