0

I have created a lightning component and want to create a package for that i wrote a test class for apex class coverage too which is showing 100% code coverage but when iam trying to upload the aura component iam getting the following error.

No test methods found in the Apex code included in the package. At least 75% test coverage is required.

Can some one help here.

4
  • Did you include your test class in the package?
    – David Reed
    Commented Jul 20, 2019 at 13:12
  • My test class is not visible in apex classes is their any way where it can be found in while creating package Commented Jul 20, 2019 at 13:15
  • Even my apex class which i created using developer console is not visible in package manager apex class section iam using sandbox. Commented Jul 20, 2019 at 13:18
  • 1
    You cannot create managed packages in Sandboxes. Use a developer org for that or go with unlocked packages. Commented Jul 20, 2019 at 13:21

1 Answer 1

0

Remember to add the @isTest annotation to both the main class definition and each test method:

@isTest
private class MyTestClass {

    @isTest static void MyTestMethod1() {
        // Unit tests here...
    }

    @isTest static void MyTestMethod2() {}

}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .