AppCode 2017.1 Help

Testing JavaScript

In AppCode, you can run JavaScript test cases, methods, or entire test files against a local or remote test server using Cucumber.js, Jest, JSTestDriver, Karma, Mocha, or Protractor.

You can quickly jump from source code to the related test file with the Go to test action (⌃⇧T or Navigate | Test). For example, from auth.js you can jump to auth.test.js.

You can also see whether a test has passed or failed right in the editor, thanks to the test status icons ws_icon_test_status.png in the left gutter.

For Mocha and Jest, you can run and debug tests and suites right from the editor: click run.png or rerun.png in the left gutter and choose Run <test_file_name> or Debug <test_file_name> from the pop-up list.

ws_run_test_from_editor.png

With JSTestDriver and Karma, you can also monitor how much of your code is covered with tests. AppCode displays this statistics in a dedicated tool window and marks covered and uncovered lines visually right in the editor.

In this part:

See Also

Last modified: 28 March 2017