Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ' from testNamePatterns to fix failing tests #96

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lua/neotest-jest/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ function adapter.build_spec(args)
end

local pos = args.tree:data()
local testNamePattern = "'.*'"
local testNamePattern = ".*"

if pos.type == "test" or pos.type == "namespace" then
-- pos.id in form "path/to/file::Describe text::test text"
Expand All @@ -386,9 +386,9 @@ function adapter.build_spec(args)
testNamePattern = pos.is_parameterized
and parameterized_tests.replaceTestParametersWithRegex(testNamePattern)
or testNamePattern
testNamePattern = "'^" .. testNamePattern
testNamePattern = "^" .. testNamePattern
if pos.type == "test" then
testNamePattern = testNamePattern .. "$'"
testNamePattern = testNamePattern .. "$"
else
testNamePattern = testNamePattern .. "'"
end
Expand Down
2 changes: 1 addition & 1 deletion tests/init_options_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("build_spec with override", function()
assert.contains(command, binary_override())
assert.contains(command, "--json")
assert.contains(command, "--config=" .. config_override())
assert.contains(command, "--testNamePattern='.*'")
assert.contains(command, "--testNamePattern=.*")
assert.contains(command, "./spec/basic.test.ts")
assert.is.truthy(spec.context.file)
assert.is.truthy(spec.context.results_path)
Expand Down
2 changes: 1 addition & 1 deletion tests/init_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe("build_spec", function()
assert.contains(command, "jest")
assert.contains(command, "--json")
assert.is_not.contains(command, "--config=jest.config.js")
assert.contains(command, "--testNamePattern='.*'")
assert.contains(command, "--testNamePattern=.*")
assert.contains(command, "./spec/basic.test.ts")
assert.is.truthy(spec.context.file)
assert.is.truthy(spec.context.results_path)
Expand Down
Loading