{"id":18619,"library":"noodl-test-utils","title":"noodl-ui-test-utils","description":"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.","status":"active","version":"0.0.47","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","noodl-ui","noodl","unit","test","noodlui","aitmed","typescript"],"install":[{"cmd":"npm install noodl-test-utils","lang":"bash","label":"npm"},{"cmd":"yarn add noodl-test-utils","lang":"bash","label":"yarn"},{"cmd":"pnpm add noodl-test-utils","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for testing React components","package":"react","optional":false},{"reason":"core library being tested","package":"noodl-ui","optional":false}],"imports":[{"note":"ESM-only when using TypeScript; CJS require may work but is deprecated.","wrong":"const { render } = require('noodl-test-utils')","symbol":"render","correct":"import { render } from 'noodl-test-utils'"},{"note":"The export is camelCase, not PascalCase.","wrong":"import { MockProvider } from 'noodl-test-utils'","symbol":"mockProvider","correct":"import { mockProvider } from 'noodl-test-utils'"},{"note":"fireEvent is a named export, not default.","wrong":"import fireEvent from 'noodl-test-utils'","symbol":"fireEvent","correct":"import { fireEvent } from 'noodl-test-utils'"}],"quickstart":{"code":"import { render, fireEvent } from 'noodl-test-utils';\nimport { Button } from 'noodl-ui';\n\nconst { getByText } = render(<Button>Click me</Button>);\nconst button = getByText('Click me');\nfireEvent.click(button);\nconsole.log('Button tested');","lang":"typescript","description":"Renders a Button component from noodl-ui and simulates a click event using fireEvent."},"warnings":[{"fix":"Pin to exact version or use version ranges with caution.","message":"API changes frequently; breaking changes may occur in minor versions prior to 1.0.0.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Use import syntax instead of require.","message":"CJS require pattern is deprecated; use ESM imports for full TypeScript support.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Call mockProvider.cleanup() in your test teardown.","message":"mockProvider does not reset between tests automatically; you must call cleanup() in afterEach.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure mockProvider is imported from 'noodl-test-utils' and wrapped around your component.","cause":"mockProvider was not imported correctly or noodl-ui context not set up.","error":"TypeError: Cannot read properties of undefined (reading 'Provider')"},{"fix":"Make sure you are using render from noodl-test-utils, not from @testing-library/react.","cause":"Incorrect usage of fireEvent or render outside of test environment.","error":"Attempted to log. This is a bug in React Testing Library."},{"fix":"Add a unique key prop to each list item in your rendered component.","cause":"Component under test is missing key props in a list.","error":"Warning: Each child in a list should have a unique 'key' prop."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}