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

Add task to run testthat::test_file() on current file #1415

Merged
merged 1 commit into from
Oct 7, 2023

Conversation

gowerc
Copy link
Contributor

@gowerc gowerc commented Sep 5, 2023

What problem did you solve?

Added a VScode task to run testthat::test_file() on the currently open file. This is particularly useful when snapshot tests which don't really work in batch or if you have a large test script that you want to run but you don't want to run your entire test suite.

Likewise it looks like the failure string is slightly different for this function so I attempted to modify the regex to ensure the problem matching still works.

(If you have)Screenshot

In this GIF I show that the feature works and correctly errors for a failed test whilst it works correctly if I open a file that has a successful test.

2023-09-05 17 21 07

@gowerc gowerc changed the title Add task to test current file Add task to run testthat::test_file() on current file Sep 5, 2023
@gowerc
Copy link
Contributor Author

gowerc commented Sep 5, 2023

The lintr has failed even though I haven't touched a single R file 😕 I'm assuming this is a lingering issue and not a blocker to my PR ?

Copy link
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

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

LGTM Thanks!

@renkun-ken renkun-ken merged commit f5207d7 into REditorSupport:master Oct 7, 2023
7 of 8 checks passed
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