Unit tests in the Splunk SDK for JavaScript

A great place to look for examples of how to use the Splunk® SDK for JavaScript is in the unit tests. These are the same tests that we used to validate the core SDK library. The SDK includes several unit tests for each component.

All development activities are managed by a helper script called sdkdo. To run the tests at the command line, go to the /splunk-sdk-javascript directory, then:

  • To run all tests, enter the following command:
  • node sdkdo tests
    
  • To run the HTTP and the Async tests, enter:
  • node sdkdo tests http,async
    
  • To run the browser tests, enter:
  • node sdkdo tests-browser