posit-dev / posit-dev/positron
Account for nested `describe()` in R test explorer
Open
Nobody has claimed this yet.
lang: r
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
The positron-r test explorer still has some missing functionality around nested describe() like this:
describe("top-level describe with describe inside", {
describe("nested describe 1", {
it("can 'add' two numbers", {
expect_equal(1 + 1, addition(1, 1))
#expect_equal('a', 'b')
})
})
describe("nested describe 2", {
it("can multiply two numbers", {
expect_equal(10 * 2, multiplication(10, 2))
})
it("can handle division by 0") #not yet implemented
})
})
Problems include:
describe("top-level describe with describe inside", { ... })does not appear in the tree view, because we only walk up to the immediate parent of anit()during test discovery.- If the user clicks on ▶️ for a nested
describe(), it would be nice to hop up to the enclosing, top-leveldescribe()and run that instead of doing nothing (other than logging that this is impossible). Ditto for anit(). - Clicking on ▶️ in the tree view for a
describe()with exactly 1 (one)it()results in running theit(), which obviously fails. Why does it run theit()? Need to determine if this is a "me" problem or a bug in VS Code. Clicking on ▶️ in the gutter of the test file does run the singledescribe()appropriately. This has nothing to do with a nesteddescribe()btw.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the positron-r test explorer's discovery and tree execution paths, using the nested describe() example in the issue. Compare tree-view ▶️ behavior with running from the test file gutter in VS Code; done means nested describes appear, their actions run the enclosing top-level describe, and the single-it case is correctly handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript
- Domain
- developer-experience, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100