{"_id":"@deijose/nix-js-testing","_rev":"5-c148a294ad11b76d13516ad4f4c4fdf3","name":"@deijose/nix-js-testing","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@deijose/nix-js-testing","version":"0.1.0","keywords":["nix","nix-js","testing","test-utils","signals","vitest"],"author":{"name":"Deiver Vasquez"},"license":"MIT","_id":"@deijose/nix-js-testing@0.1.0","maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"dist":{"shasum":"96043a9f908b813516874c1d7c8b1b76f5151a7d","tarball":"https://registry.npmjs.org/@deijose/nix-js-testing/-/nix-js-testing-0.1.0.tgz","fileCount":30,"integrity":"sha512-zIlyMzIosY05ils/Do57VhzD3K3B9OzQ12E6MnSgLaoiZVQ8DRDQOuSMpMq1zGGY8g7zqP0/u6hES400pZjeGA==","signatures":[{"sig":"MEUCIHdRLbP4P5TeRALoahoJrnM15EJYjbuh9DNWT1zp2smJAiEA57mw54U8ShWRDvOyaBwQeL8J3bSYvtXLYcgz6uf7bZc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43193},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","coverage":"vitest run --coverage","prepublishOnly":"bun run build"},"_npmUser":{"name":"deijose","email":"estudiandovazmore@gmail.com"},"_npmVersion":"11.13.0","description":"Testing utilities for Nix.js — lightweight, DOM-agnostic and tree-shakeable","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","happy-dom":"^20.8.3","typescript":"~5.9.3","@types/node":"^22.0.0","@deijose/nix-js":"^2.5.0"},"peerDependencies":{"@deijose/nix-js":"^2.5.0"},"peerDependenciesMeta":{"@deijose/nix-js":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nix-js-testing_0.1.0_1782179673169_0.055025469112890635","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@deijose/nix-js-testing","version":"0.1.1","keywords":["nix","nix-js","testing","test-utils","signals","vitest"],"author":{"name":"Deiver Vasquez"},"license":"MIT","_id":"@deijose/nix-js-testing@0.1.1","maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"dist":{"shasum":"6b7eb3d1439a8d50428949f166171586fe0ee9e8","tarball":"https://registry.npmjs.org/@deijose/nix-js-testing/-/nix-js-testing-0.1.1.tgz","fileCount":30,"integrity":"sha512-gaMyfyKIIbuXN7X1YGtw8sA0y3ac9Gp7rjOEWIXAwvnRf8tZjc8qbIV2M58tFo72tvhal3D/S7gxJPSTptr0NQ==","signatures":[{"sig":"MEUCIQD7z4xqPuAA9VsAsM+YTZyglwRhXtrbMKSee625EsGaywIgKcy/v9xLgd4k5jzWVsSBaf+/E6reE9M7areSOlDm/NA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43192},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"cab466a99bc57528f046be0d9f45a4af41d4a144","scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","coverage":"vitest run --coverage","prepublishOnly":"bun run build"},"_npmUser":{"name":"deijose","email":"estudiandovazmore@gmail.com"},"_npmVersion":"11.13.0","description":"Testing utilities for Nix.js — lightweight, DOM-agnostic and tree-shakeable","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","happy-dom":"^20.8.3","typescript":"~5.9.3","@types/node":"^22.0.0","@deijose/nix-js":"^2.5.1"},"peerDependencies":{"@deijose/nix-js":"^2.5.1"},"peerDependenciesMeta":{"@deijose/nix-js":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nix-js-testing_0.1.1_1782181664057_0.9305224270715562","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@deijose/nix-js-testing","version":"0.1.2","keywords":["nix","nix-js","testing","test-utils","signals","vitest"],"author":{"name":"Deiver Vasquez"},"license":"MIT","_id":"@deijose/nix-js-testing@0.1.2","maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"dist":{"shasum":"d5d084ec552aa4c21eccd4e432019926fb1e8988","tarball":"https://registry.npmjs.org/@deijose/nix-js-testing/-/nix-js-testing-0.1.2.tgz","fileCount":30,"integrity":"sha512-vHk78cQPXtQT7DKU75O3YimX4dnV9uM4inhP+cmZQd1bSt/y9in2gbL1YUpgzVI6kxXNGERN8h+cOSS34TT4Kg==","signatures":[{"sig":"MEUCIQDIsbuGR2LEgT7HJi0hzfj7/LACxs+n489VoNdfBqnilAIgInEKoxz9QC76s+/895Tfv1IMXrGA4gaVtvcp+fNPp0I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43192},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2dd56a2902384564168b6c4e8dcec00d7c007c00","scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","coverage":"vitest run --coverage","prepublishOnly":"bun run build"},"_npmUser":{"name":"deijose","email":"estudiandovazmore@gmail.com"},"_npmVersion":"11.13.0","description":"Testing utilities for Nix.js — lightweight, DOM-agnostic and tree-shakeable","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","happy-dom":"^20.8.3","typescript":"~5.9.3","@types/node":"^22.0.0","@deijose/nix-js":"^2.5.2"},"peerDependencies":{"@deijose/nix-js":"^2.5.2"},"peerDependenciesMeta":{"@deijose/nix-js":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nix-js-testing_0.1.2_1782184634835_0.24735834103209986","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@deijose/nix-js-testing","version":"0.1.3","keywords":["nix","nix-js","testing","test-utils","signals","vitest"],"author":{"name":"Deiver Vasquez"},"license":"MIT","_id":"@deijose/nix-js-testing@0.1.3","maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"dist":{"shasum":"3c87bb216381ad29adc031cdf914e64d370974be","tarball":"https://registry.npmjs.org/@deijose/nix-js-testing/-/nix-js-testing-0.1.3.tgz","fileCount":30,"integrity":"sha512-GcJSwOw4or+SLRccSoxGwvVBpvf1wkJB50nYWAi7YxfS4+DzGnkVafMylg6ga9q0HFgNl6bCafWct7FiWWmmxA==","signatures":[{"sig":"MEUCIQCnFMxGPwaw9T7NYpOhSH/N9T6Ou0YhgVpOB5i5RrIvmAIgW/GMf8PVP73nmkOXga1c+h+Fza5nGkCdDvYYmRJoaFc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43196},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8e4dfd0bb0404f6df25d545d7c0c8d3391adfb5b","scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","coverage":"vitest run --coverage","prepublishOnly":"bun run build"},"_npmUser":{"name":"deijose","email":"estudiandovazmore@gmail.com"},"_npmVersion":"11.13.0","description":"Testing utilities for Nix.js — lightweight, DOM-agnostic and tree-shakeable","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","happy-dom":"^20.8.3","typescript":"~5.9.3","@types/node":"^22.0.0","@deijose/nix-js":"^2.5.3"},"peerDependencies":{"@deijose/nix-js":"^2.5.3"},"peerDependenciesMeta":{"@deijose/nix-js":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nix-js-testing_0.1.3_1782230925865_0.9924261873444149","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@deijose/nix-js-testing","version":"0.1.4","description":"Testing utilities for Nix.js — lightweight, DOM-agnostic and tree-shakeable","license":"MIT","author":{"name":"Deiver Vasquez"},"type":"module","keywords":["nix","nix-js","testing","test-utils","signals","vitest"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"build":"tsc","dev":"tsc --watch","test":"vitest run","coverage":"vitest run --coverage","prepublishOnly":"bun run build"},"peerDependencies":{"@deijose/nix-js":"^2.5.3 || ^3.0.0"},"peerDependenciesMeta":{"@deijose/nix-js":{"optional":false}},"devDependencies":{"@deijose/nix-js":"3.0.3","@types/node":"^22.0.0","happy-dom":"^20.8.3","typescript":"~5.9.3","vitest":"^4.0.18"},"engines":{"node":">=18.0.0"},"_id":"@deijose/nix-js-testing@0.1.4","gitHead":"f60c95a91012b1de67c491b26e7051e5242598a4","_nodeVersion":"22.14.0","_npmVersion":"10.9.9","dist":{"integrity":"sha512-VJQ4utYx3rxVy7chVhYnHbtV4vu/EGedOepBTrbpmMgGGIoyg6SYUOcQ2cWPDNeTQ07mf3n3oYdtlnYH4yH7/A==","shasum":"2c9200ed2ae4c176499894bf9e3807871325cb93","tarball":"https://registry.npmjs.org/@deijose/nix-js-testing/-/nix-js-testing-0.1.4.tgz","fileCount":30,"unpackedSize":43202,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDKvqFN4sN2HnUH+LFUZTHHc+Mo1g9sWE1K+79DhC4O8wIgGMYgvgLW4wqhA+M0IZtX6eJ3pPqrFuy/mwMG9UVdMQ8="}]},"_npmUser":{"name":"deijose","email":"estudiandovazmore@gmail.com"},"directories":{},"maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nix-js-testing_0.1.4_1787279927213_0.12462421111656452"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T01:54:32.959Z","modified":"2026-08-21T02:38:47.497Z","0.1.0":"2026-06-23T01:54:33.304Z","0.1.1":"2026-06-23T02:27:44.238Z","0.1.2":"2026-06-23T03:17:14.951Z","0.1.3":"2026-06-23T16:08:46.006Z","0.1.4":"2026-08-21T02:38:47.339Z"},"author":{"name":"Deiver Vasquez"},"license":"MIT","keywords":["nix","nix-js","testing","test-utils","signals","vitest"],"description":"Testing utilities for Nix.js — lightweight, DOM-agnostic and tree-shakeable","maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"readme":"# @deijose/nix-js-testing\n\nUtilidades de testing para [Nix.js](https://github.com/DeijoseDevelop/nix-js). Liviano, tree-shakeable y agnóstico al DOM environment (funciona con `happy-dom`, `jsdom`, etc.).\n\n## Instalación\n\n```bash\nnpm install -D @deijose/nix-js-testing\n```\n\nTambién necesitas un entorno DOM. Recomendamos `happy-dom`:\n\n```bash\nnpm install -D happy-dom\n```\n\nY en `vite.config.ts`:\n\n```ts\nexport default defineConfig({\n  test: {\n    environment: \"happy-dom\",\n  },\n});\n```\n\n## Uso\n\n```ts\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, fireEvent } from \"@deijose/nix-js-testing\";\nimport { html, signal } from \"@deijose/nix-js\";\n\nfunction Counter() {\n  const count = signal(0);\n  return html`\n    <div>\n      <span data-testid=\"count\">${count.value}</span>\n      <button onclick=${() => count.value++}>Increment</button>\n    </div>\n  `;\n}\n\ndescribe(\"Counter\", () => {\n  it(\"increments on click\", () => {\n    const { getByText } = render(Counter());\n    const button = getByText(\"Increment\");\n    fireEvent.click(button);\n    expect(screen.getByTestId(\"count\").textContent).toBe(\"1\");\n  });\n});\n```\n\n## API\n\n### `render(component, options?)`\n\nMonta un componente Nix.js en un contenedor. Retorna queries vinculadas al contenedor y `unmount()`.\n\n```ts\nconst { container, getByText, unmount } = render(MyComponent());\n```\n\n### `screen`\n\nQueries globales sobre `document.body`:\n\n- `screen.getByText`\n- `screen.queryByText`\n- `screen.getByRole`\n- `screen.getByTestId`\n- `screen.getByLabelText`\n- `screen.getByPlaceholderText`\n- `screen.getByDisplayValue`\n\n### `fireEvent`\n\nDispara eventos DOM:\n\n```ts\nfireEvent.click(button);\nfireEvent.input(input, { target: { value: \"hello\" } });\nfireEvent.keyDown(input, { key: \"Enter\" });\nfireEvent.submit(form);\n```\n\nTambién puedes usar el genérico:\n\n```ts\nfireEvent(element, \"custom-event\");\n```\n\n### `waitFor`\n\nEspera a que una condición se cumpla:\n\n```ts\nawait waitFor(() => {\n  expect(screen.getByText(\"Loaded\")).toBeInTheDocument();\n});\n```\n\n### `cleanup`\n\nDesmonta todos los componentes renderizados durante el test:\n\n```ts\nimport { cleanup } from \"@deijose/nix-js-testing\";\n\nafterEach(() => cleanup());\n```\n\n## Características\n\n- **Sin DOM environment empaquetado**: tú eliges `happy-dom` o `jsdom`.\n- **Tree-shakeable**: importa solo lo que necesites.\n- **Zero peso en producción**: no se incluye en el bundle de la app.\n- **API similar a Testing Library**: fácil de adoptar.\n\n## Licencia\n\nMIT\n","readmeFilename":"README.md"}