posit-dev / posit-dev/positron

Account for nested `describe()` in R test explorer

Open
#2,805 0 comments 0 reactions 0 assignees View on GitHub

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 an it() during test discovery.
  • If the user clicks on ▶️ for a nested describe(), it would be nice to hop up to the enclosing, top-level describe() and run that instead of doing nothing (other than logging that this is impossible). Ditto for an it().
  • Clicking on ▶️ in the tree view for a describe() with exactly 1 (one) it() results in running the it(), which obviously fails. Why does it run the it()? 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 single describe() appropriately. This has nothing to do with a nested describe() btw.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.