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

test: remove duplicate test for killing previous rg search #153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ describe("in debug mode", () => {
})
})

// TODO add a test for "can clean up (kill) a previous search". This is too
// fast and currently needs to be timing based (👎🏻).

afterEach(() => {
verifyGitGrepBackendWasUsedInTest()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,43 +248,4 @@ describe("in debug mode", () => {
})
})
})

it("can clean up (kill) a previous search", () => {
// to save resources, the plugin should clean up a previous search when a
// new search is started. Blink should handle this internally, see
// https://github.com/mikavilpas/blink-ripgrep.nvim/issues/102

cy.visit("/")
cy.startNeovim({}).then((nvim) => {
// wait until text on the start screen is visible
cy.contains("If you see this text, Neovim is ready!")
createGitReposToLimitSearchScope()

// clear the current line and enter insert mode
cy.typeIntoTerminal("cc")

// debug mode should be on by default for all tests. Otherwise it doesn't
// make sense to test this, as nothing will be displayed.
nvim.runLuaCode({
luaCode: `assert(require("blink-ripgrep").config.debug)`,
})

// search for something that does not exist. This should start a couple
// of searches
cy.typeIntoTerminal("yyyyyy", { delay: 80 })
nvim.runExCommand({ command: "messages" }).then((result) => {
expect(result.value).to.contain(
"killed previous RipgrepBackend invocation",
)
})
nvim
.runLuaCode({
luaCode: `return _G.blink_ripgrep_invocations`,
})
.should((result) => {
expect(result.value).to.be.an("array")
expect(result.value).to.have.length.above(3)
})
})
})
})
Loading