Skip to content

Commit

Permalink
Merge pull request #67 from StephenABoyd/jest-command-args
Browse files Browse the repository at this point in the history
Use args.jestCommand if exists as an override
  • Loading branch information
haydenmeade authored Dec 17, 2023
2 parents a67bce4 + 71d7e66 commit 2ee78ce
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/init_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ describe("build_spec", function()
assert.is.truthy(spec.context.results_path)
end)

async.it("builds command for file test with jestCommand arg", function()
local positions = plugin.discover_positions("./spec/basic.test.ts"):to_list()
local tree = Tree.from_list(positions, function(pos)
return pos.id
end)
local spec = plugin.build_spec({ tree = tree, jestCommand = 'jest --watch ' })

assert.is.truthy(spec)
local command = spec.command
assert.is.truthy(command)
assert.contains(command, "jest")
assert.contains(command, "--watch")
assert.contains(command, "--json")
assert.is_not.contains(command, "--config=jest.config.js")
assert.contains(command, "--testNamePattern='.*'")
assert.contains(command, "./spec/basic.test.ts")
assert.is.truthy(spec.context.file)
assert.is.truthy(spec.context.results_path)
end)

async.it("builds command for namespace", function()
local positions = plugin.discover_positions("./spec/basic.test.ts"):to_list()

Expand Down

0 comments on commit 2ee78ce

Please sign in to comment.