Test Slack Apps
Write unit tests to verify whether your Apex code is working properly. Unit tests are class methods that don't take arguments or commit data to the database.
Slack app testing includes several files.
- The Apex class to be tested
- The Apex unit tests
In your SFDX project, create an Apex unit test in the
Create a test class and annotate it with
@isTest. Similarly, annotate your class methods with
Name your test class using the format
Declare your test harness variables to store the Slack state and user session. To set up your test harness and simulate user interactions, use the Slack.TestHarness class.
For more information, see Testing Examples.
The ApexClass metadata file represents an Apex class, which you include for each test class.
The ApexTestSuite metadata file represents a suite of Apex test classes to include in a test run.