I am encountering a bizarre issue with one of our sandbox orgs.
I modified a LWC in our testing org and I wanted to deploy the changes with a change set to a secondary sandbox org.
For some reason, when deploying the change set, it failed saying an apex class needs recompilation with the message that the method "isRunningTest" from the Test namespace wasn't recognized.
It was weird because the Apex class wasn't used by my LWC. I decided to compile all the apex classes in that org and virtually every class couldn't compile because the Test methods aren't recognized:
I've never encountered a similar issue beforem so I don't really know how to go on from here. I compiled my classes in our testing sandbox org and this doesn't happen.
Any help is appreciated
Test
?/services/data/v58.0/tooling/sobjects/ApexClass/Name/Test
, and see if you get a result.