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

Tooling for testing of interactive exercises #698

Closed
wants to merge 0 commits into from

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented May 24, 2022

Adds experimental support for testing exercises with testthat.

Preview documentation: Developer Tools > Exercises

gadenbuie added a commit to rstudio/gradethis that referenced this pull request May 25, 2022
Previously, `split_code_headers()` was a staticexport from learnr, but after rstudio/learnr#698 it will no longer be used by learnr, so it's being moved here.
@gadenbuie gadenbuie marked this pull request as ready for review May 25, 2022 20:36
@gadenbuie gadenbuie requested a review from rossellhayes May 25, 2022 20:36
Copy link
Contributor

@rossellhayes rossellhayes left a comment

Choose a reason for hiding this comment

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

This is a great feature! I feel like it's a little above my skill level to say that I approve this, but I certainly don't see anything wrong with it!

R/mock_exercise.R Outdated Show resolved Hide resolved
Copy link
Member Author

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

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

revisit error argument of expect_feedback() (think through all cases)

Copy link
Member Author

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

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

Should be able to programmatically provide user_code to expect_feedback()

@gadenbuie
Copy link
Member Author

Should be able to programmatically provide user_code to expect_feedback()

The solution is that expect_feedback() will now use the .exercise$code as user_code if missing(user_code). To make this a little more ergonomic, we'll also make sure that the test_that_exercise() makes .exercise available to users so they can overwrite $code.

@gadenbuie gadenbuie closed this Jun 2, 2022
@gadenbuie gadenbuie force-pushed the tests-expect-feedback branch from ec8dc34 to bd2e793 Compare June 2, 2022 16:25
@gadenbuie gadenbuie deleted the tests-expect-feedback branch June 2, 2022 16:25
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