{"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,"search_vec":"'/react':73 '0.0.47':16 '1.0.0':59 'aitm':41,86 'altern':68 'api':62 'assert':34 'chang':67 'complement':44 'compon':13,27 'declar':55 'ecosystem':42 'general':75 'helper':20 'includ':28,69 'javascript':78 'librari':14,50,72 'main':46 'may':66 'mock':29 'noodl':2,11,25,48,80,82 'noodl-ui':10,24,47,79 'noodl-ui-test-util':1 'noodlui':85 'packag':18,52 'part':38 'pre':58 'provid':19,30 'react':76 'releas':60 'render':32 'ship':53 'test':4,6,23,31,71,77,84 'testing-librari':70 'typescript':54,87 'ui':3,12,26,49,81 'unit':22,83 'unstabl':64 'util':5,7,35 'version':15","created_at":"2026-04-25T07:39:15.419671+00:00","updated_at":"2026-04-25T07:39:15.419671+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/noodl-test-utils","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}