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: refactor tests using didOpen notification #337

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

NJichev
Copy link
Collaborator

@NJichev NJichev commented Nov 14, 2023

Uses a macro to hide the miscellaneous setup for the document didOpen notification.

Uses a macro to hide the miscellaneous setup for the document didOpen
notification.
test/support/utils.ex Outdated Show resolved Hide resolved
end

defmacro did_open(client, file_path) do
did_open(client, file_path, File.read!(file_path))
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not clear to me if reading the file at compile time will work as the files are written to disk when the test is running

Copy link
Collaborator Author

@NJichev NJichev Nov 14, 2023

Choose a reason for hiding this comment

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

Yes you're correct but I think I can fix it in the other PR and remove it for now, I will probably just inline the whole other macro and call File.read!(unquote(file_path)). I hadn't tested it here since the existing tests that use it just use text instead of real files.

@NJichev NJichev changed the title Refactor tests using didOpen notification test: Refactor tests using didOpen notification Nov 14, 2023
@mhanberg mhanberg changed the title test: Refactor tests using didOpen notification test: refactor tests using didOpen notification Nov 14, 2023
@mhanberg mhanberg merged commit cc0bf62 into elixir-tools:main Nov 14, 2023
6 of 8 checks passed
@NJichev NJichev deleted the refactor-did-open-notifications branch November 14, 2023 16:58
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