Registry / testing / noodl-test-utils

noodl-test-utils

JSON →
library0.0.47jsnpmunverified

Test utilities for the noodl-ui component library, version 0.0.47. This package provides helpers for unit testing noodl-ui components, including mock providers, test renderers, and assertion utilities. It is part of the AITMED ecosystem and complements the main noodl-ui library. The package ships TypeScript declarations. As a pre-1.0.0 release, its API is unstable and may change. Alternatives include @testing-library/react for general React testing.

npm install noodl-test-utils
INSTALL
IMPORT
SIG · NOODL-TEST-UTILS
N
noodl-test-utils
testingjavascriptv0.0.47
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

render
✓ import { render } from 'noodl-test-utils'
✗ const { render } = require('noodl-test-utils')
ESM-only when using TypeScript; CJS require may work but is deprecated.
mockProvider
✓ import { mockProvider } from 'noodl-test-utils'
✗ import { MockProvider } from 'noodl-test-utils'
The export is camelCase, not PascalCase.
fireEvent
✓ import { fireEvent } from 'noodl-test-utils'
✗ import fireEvent from 'noodl-test-utils'
fireEvent is a named export, not default.

Renders a Button component from noodl-ui and simulates a click event using fireEvent.

import { render, fireEvent } from 'noodl-test-utils'; import { Button } from 'noodl-ui'; const { getByText } = render(<Button>Click me</Button>); const button = getByText('Click me'); fireEvent.click(button); console.log('Button tested');
Debug
Known issues
breakingAPI changes frequently; breaking changes may occur in minor versions prior to 1.0.0.
fix
Pin to exact version or use version ranges with caution.
affects: <1.0.0
deprecatedCJS require pattern is deprecated; use ESM imports for full TypeScript support.
fix
Use import syntax instead of require.
affects: >=0.0.0
gotchamockProvider does not reset between tests automatically; you must call cleanup() in afterEach.
fix
Call mockProvider.cleanup() in your test teardown.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'Provider')
mockProvider was not imported correctly or noodl-ui context not set up.
fix
Ensure mockProvider is imported from 'noodl-test-utils' and wrapped around your component.
Attempted to log. This is a bug in React Testing Library.
Incorrect usage of fireEvent or render outside of test environment.
fix
Make sure you are using render from noodl-test-utils, not from @testing-library/react.
Warning: Each child in a list should have a unique 'key' prop.
Component under test is missing key props in a list.
fix
Add a unique key prop to each list item in your rendered component.
Upgrade
Version history
0.0.47latest on npm
Audit
Dependencies
reactrequiredpeer dependency for testing React components
noodl-uirequiredcore library being tested
Agent activity
4 hits · last 30 days
node
4
Resources
noodl-test-utils — npm install noodl-test-utils · libregistry