Skip to content

Commit

Permalink
feat: add option to skip dependency check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamad Arif Hidayat committed Jan 7, 2025
1 parent 514fd4e commit a145db7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/neotest-jest/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local parameterized_tests = require("neotest-jest.parameterized-tests")
---@field env? table<string, string>|fun(): table<string, string>
---@field cwd? string|fun(): string
---@field strategy_config? table<string, unknown>|fun(): table<string, unknown>
---@field skipDependencyCheck? boolean

---@type neotest.Adapter
local adapter = { name = "neotest-jest" }
Expand Down Expand Up @@ -52,6 +53,10 @@ end
---@param path string
---@return boolean
local function hasJestDependency(path)
if adapter.skipDependencyCheck then
return true
end

local rootPath = lib.files.match_root_pattern("package.json")(path)

if not rootPath then
Expand Down Expand Up @@ -528,6 +533,10 @@ setmetatable(adapter, {
adapter.jest_test_discovery = true
end

if opts.skipDependencyCheck then
adapter.skipDependencyCheck = opts.skipDependencyCheck
end

return adapter
end,
})
Expand Down

0 comments on commit a145db7

Please sign in to comment.