Conversation
There was a problem hiding this comment.
Pull request overview
This PR teaches the test_active_file() function to recognize and handle snapshot files by adding support for detecting snapshot file types and mapping them back to their corresponding test files.
Changes:
- Added logic to identify snapshot files (
.mdfiles in_snapsdirectories) as type "snap" - Extended support to handle both direct snapshot files and snapshot variant files (in subdirectories)
- Added comprehensive test coverage for the new snapshot file detection functionality
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| R/active.R | Added detection logic for snapshot files by checking for _snaps directory and .md extension |
| tests/testthat/test-active.R | Added tests verifying snapshot file detection and mapping to test files for both regular and variant snapshots |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| test_file_type <- function(path) { | ||
| dir <- path_file(path_dir(path)) | ||
| parent_dir <- path_file(path_dir(path_dir(path))) |
There was a problem hiding this comment.
The variable name parent_dir is misleading. This variable contains the name of the parent directory (e.g., '_snaps'), not the parent directory path itself. Consider renaming it to parent_dir_name or grandparent_dir_name to clarify that it represents the directory name, not the path.
|
I accidentally requested the copilot review. |
No description provided.