Skip to content

test: testing for picking the last line with marker #9

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

brunotvs
Copy link
Contributor

@brunotvs brunotvs commented Jan 5, 2025

No description provided.

@@ -140,4 +140,10 @@ describe('Result from running busted', function()
expected, results = compute_test_results('single-standalone-error', 'prepend', 'append')
assert.are.same(expected, results)
end)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is trailing whitespace on the line.

@@ -140,4 +140,10 @@ describe('Result from running busted', function()
expected, results = compute_test_results('single-standalone-error', 'prepend', 'append')
assert.are.same(expected, results)
end)

it('Picks last line with marker', function()
local marker = require'neotest-busted._output-handler'.marker
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My style is to have the parentheses when require is part of a larger expression.

Suggested change
local marker = require'neotest-busted._output-handler'.marker
local marker = require('neotest-busted._output-handler').marker


it('Picks last line with marker', function()
local marker = require'neotest-busted._output-handler'.marker
local expected, results = compute_test_results("single-standalone-error", marker..'some text', "append")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer single quotes.

Suggested change
local expected, results = compute_test_results("single-standalone-error", marker..'some text', "append")
local expected, results = compute_test_results('single-standalone-error', marker..'some text', 'append')

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this file? It serves a different purpose because it is meant to trigger the entirety of the adapter, not just the result aggregation function. As the note states, this should be an end-to-end test, but I was not yet able to figure out how write one.

And end-to-end test starts a new Neovim process, uses the Neovim API to do something in the remote process and checks if the remote process is in the desired state. The problem is that everything in Neotest is asynchronous, so I would need to tell the remote Neovim "run this test, and then when you are done tell me the result". I have no idea how to do that, so the best I can do is manually run that test from inside Neovim. It's a manual end-to-end test, which is still better than nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that everything in Neotest is asynchronous, so I would need to tell the remote Neovim "run this test, and then when you are done tell me the result".

Tried to acomplish that. Seems to be running, but I could not figure how to output usefull messages whe the plugin fails, and not a test.

@brunotvs brunotvs marked this pull request as draft January 8, 2025 17:15
@brunotvs brunotvs marked this pull request as ready for review January 8, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants