-1

I have written a test class for my apex class

The test class covers 98%.

but the test class fails.

will the coverage be considered.?

9

If your test class fails it will lead to a failed deployment or failed package upload, so your test class MUST pass.

Also, you should not write test classes to get coverage, but to actually test your code. Otherwise they would be called coverage classes and not test classes.

| improve this answer | |
2

The test class needs to pass! Coverage is considered but

failed test class = failed deployment.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.