{"id":15770610,"url":"https://github.com/benelan/neotest-stenciljs","last_synced_at":"2025-10-04T14:12:30.425Z","repository":{"id":223432893,"uuid":"760232557","full_name":"benelan/neotest-stenciljs","owner":"benelan","description":"An unofficial StencilJS adapter for the \"neotest\" nvim plugin","archived":false,"fork":false,"pushed_at":"2024-08-15T08:05:22.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-26T18:50:41.804Z","etag":null,"topics":["neotest","neovim","plugin","published","stenciljs"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benelan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-20T03:04:28.000Z","updated_at":"2024-07-09T10:27:05.000Z","dependencies_parsed_at":"2024-03-01T09:38:38.665Z","dependency_job_id":"95a11627-d718-493e-bb85-2f6598398e48","html_url":"https://github.com/benelan/neotest-stenciljs","commit_stats":null,"previous_names":["benelan/neotest-stenciljs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benelan/neotest-stenciljs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fneotest-stenciljs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fneotest-stenciljs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fneotest-stenciljs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fneotest-stenciljs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benelan","download_url":"https://codeload.github.com/benelan/neotest-stenciljs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fneotest-stenciljs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278322146,"owners_count":25967874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neotest","neovim","plugin","published","stenciljs"],"created_at":"2024-10-04T14:43:20.737Z","updated_at":"2025-10-04T14:12:30.408Z","avatar_url":"https://github.com/benelan.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neotest-stenciljs\n\nThis plugin provides a [StencilJS](https://stenciljs.com) adapter for the\n[Neotest](https://github.com/rcarriga/neotest) framework.\n\n\u003c!--toc:start--\u003e\n\n- [neotest-stenciljs](#neotest-stenciljs)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n    - [Stricter file parsing to determine test files](#stricter-file-parsing-to-determine-test-files)\n    - [Filter directories searched for tests](#filter-directories-searched-for-tests)\n  - [Usage](#usage)\n    - [Running tests in watch mode](#running-tests-in-watch-mode)\n    - [Running tests without building](#running-tests-without-building)\n  - [Known issues](#known-issues)\n  - [Credits](#credits)\n  - [Disclaimer](#disclaimer)\n\n\u003c!--toc:end--\u003e\n\n## Installation\n\nInstall the adapter using your plugin manager, for example with `lazy.nvim`:\n\n```lua\n{\n  \"nvim-neotest/neotest\",\n  dependencies = {\n    \"benelan/neotest-stenciljs\",\n    -- other plugins required by neotest ...\n  },\n  config = function()\n    require(\"neotest\").setup({\n      adapters = {\n        require(\"neotest-stenciljs\")\n        -- other adapters ...\n      },\n      -- other neotest config options ...\n    })\n  end\n}\n```\n\n**IMPORTANT:** Make sure you have the appropriate `treesitter` language parsers\ninstalled, otherwise no tests will be found:\n\n```vim\n:TSInstall javascript typescript tsx\n```\n\n## Configuration\n\nSee the source code for the available configuration options:\n\nhttps://github.com/benelan/neotest-stenciljs/blob/f98366cee0b767e4779a037a9f1269c4f35bfe69/lua/neotest-stenciljs/init.lua#L7-L13\n\nAn example configuration:\n\n```lua\nrequire(\"neotest\").setup({\n  adapters = {\n    require(\"neotest-stenciljs\")({\n      no_build = true,\n      env = {\n        CI = true,\n        PUPPETEER_EXECUTABLE_PATH = \"/usr/bin/chromium-browser\"\n      }\n      cwd = function(file_path)\n        return vim.fs.dirname(file_path)\n      end\n    }),\n  }\n})\n```\n\n### Stricter file parsing to determine test files\n\nUse the `is_test_file` option to add a custom criteria for test file discovery.\nThis is helpful in monorepos where other packages use Jest or Vitest, which use\nsimilar naming patterns.\n\n```lua\n---Custom criteria for a file path to determine if it is a stencil test file\n---@async\n---@param file_path string Path of the potential stencil test file\n---@return boolean\nis_test_file = function(file_path)\n  -- check if the project is \"stencil-components\" when working in the monorepo\n  if\n    string.match(file_path, \"my-monorepo\")\n    and not string.match(file_path, \"packages/stencil-components\")\n  then\n    return false\n  end\n\n  -- this is the default condition\n  return string.match(file_path, \"%.e2e%.tsx?$\")\n    or string.match(file_path, \"%.spec%.tsx?$\")\nend,\n```\n\n### Filter directories searched for tests\n\nUse the `filter_dir` option to limit the directories to be searched for tests.\n\n```lua\n---Filter directories when searching for test files\n---@async\n---@param name string Name of directory\n---@param rel_path string Path to directory, relative to root\n---@param root string Root directory of project\n---@return boolean\nfilter_dir = function(name, rel_path, root)\n  local full_path = root .. \"/\" .. rel_path\n\n  if root:match(\"my-monorepo\") then\n    return full_path:match(\"packages/stencil-components/src\")\n  else\n  -- this is the default condition\n  return not vim.tbl_contains(\n    { \"node_modules\", \"dist\", \"hydrate\", \"www\", \".stencil\", \".storybook\" },\n    name\n  )\n  end\nend\n```\n\n## Usage\n\nSee [neotest's documentation](https://github.com/nvim-neotest/neotest#usage) for\ninformation on how to run tests.\n\n### Running tests in watch mode\n\nTo always run test(s) with the `--watchAll` flag, you can enable the option\nduring setup:\n\n```lua\nrequire('neotest').setup({\n  adapters = {\n    require('neotest-jest')({ watch = true }),\n  }\n})\n```\n\nAlternatively, you can add a specific keymap to run test(s) in watch mode:\n\n```lua\nvim.keymap.set(\n  \"n\",\n  \"\u003cleader\u003etw\",\n  \"\u003cCMD\u003elua require('neotest').run.run({ watch = true })\u003cCR\u003e\",\n  { noremap = true, desc = \"Run test (watch)\" }\n)\n```\n\n### Running tests without building\n\nStencilJS provides the `--no-build` flag to run e2e tests without building. You\ncan enable the flag during setup:\n\n```lua\nrequire('neotest').setup({\n  adapters = {\n    require('neotest-jest')({ no_build = true }),\n  }\n})\n```\n\nIf you used the watch mode keymap method above, make sure to disable the\n`--no-build` flag:\n\n```lua\nvim.keymap.set(\n  \"n\",\n  \"\u003cleader\u003etw\",\n  \"\u003cCMD\u003elua require('neotest').run.run({ watch = true, no_build = false })\u003cCR\u003e\",\n  { noremap = true, desc = \"Run test (watch)\" }\n)\n```\n\n## Known issues\n\nThis adapter currently doesn't work well with Stencil/Jest's\n[`it.each`](https://jestjs.io/docs/api#1-testeachtablename-fn-timeout)\nsyntax, but I hope to fix that in the future. Please log an issue if that's\nsomething you want supported.\n\nThe adapter also doesn't work well on tests within `for`/`forEach` loops. Using\nthe builtin [`it.each`](https://jestjs.io/docs/api#1-testeachtablename-fn-timeout)\nor [`describe.each`](https://jestjs.io/docs/api#describeeachtablename-fn-timeout)\nsyntax should be preferred anyway.\n\n## Credits\n\nThis neotest adapter was originally copied from [`neotest-jest`](https://github.com/nvim-neotest/neotest-jest)\nand [`neotest-vitest`](https://github.com/marilari88/neotest-vitest). StencilJS\n[uses Jest](https://stenciljs.com/docs/testing-overview) under the hood, so a\nlot of the code remains unchanged.\n\n## Disclaimer\n\nI am not affiliated, associated, authorized, endorsed by, or in any way\nofficially connected with StencilJS and Ionic. Any information or opinions\nexpressed in this project are solely mine and do not necessarily reflect the\nviews or opinions of StencilJS and Ionic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenelan%2Fneotest-stenciljs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenelan%2Fneotest-stenciljs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenelan%2Fneotest-stenciljs/lists"}