How to Execute Tests from Unlocked Package

Issue #2016 resolved
Luke Buthman created an issue

Hi Scott! We make heavy use of scratch orgs and unlocked packages at my current project. After marking a package directory as a Source Root, the IDE understands what the files are, notably Unit Tests. However, when I click on the button to run the test, I get the follow error.

No test methods found for execution.

I am wondering if there is a way to make this work. I have already changed the default source root to the package directory in question, but no luck. Thanks for any tips you can provide.

Comments (4)

  1. Scott Wells repo owner

    Luke, just so I understand, are the source files for these unit test classes in the local project source or only in the org via the installed package? It looks like the former, and there's no good reason that wouldn't work. IC2 shouldn't care that those classes are destined for a package of any form.

  2. Luke Buthman reporter

    You understand correctly, and I just reran everything and it worked. Must have been a glitch in the matrix. 🤔

  3. Scott Wells repo owner

    Hah! Good reference...I needed the laugh this morning. Okay, let me know if you see something like that again so we can get some logs.

  4. Log in to comment