Tutorial: Testing

Testing

Testing in browser

To run the Jasmine tests in your browser, go to the following pages:

  • <YOUR_LOCALHOST_ADDRESS>/test/E2ERunner.html - (Handsontable end-to-end test suite)
  • <YOUR_LOCALHOST_ADDRESS>/test/MobileRunner.html - (Handsontable mobile test suite)
  • <YOUR_LOCALHOST_ADDRESS>/src/3rdparty/walkontable/test/SpecRunner.html - (Walkontable test suite)

Testing with NPM (CLI)

To run Jasmine tests in your command line (using Puppeteer), first install all necessary dependencies by executing npm install. After the NPM finishes fetching required modules your workspace is ready to test.

Useful commands:

  • npm test - runs all test cases (Handsotnable and Walkontable).
  • npm test:e2e - runs only Handsontable end-to-end tests.
  • npm test:unit - runs only Handsontable unit tests.
  • npm test:walkontable - runs only Walkontable tests.
  • npm run test:e2e --testPathPattern=selection - runs only end-to-end tests and suites matching to filename "selection".
  • npm run test:unit --testPathPattern=array - runs only end-to-end tests and suites matching to filename "array".
  • npm run test:e2e.dump - generates test/E2ERunner.html file which can by executed in browser environment (Chrome, PhantomJS etc.) to check if tests passes.
  • npm run test:e2e.dump -- --watch - generates E2ERunner.html file on every change detected in test files. It can be helpful for debugging proposes.
  • npm run test:mobile.dump - generates MobileRunner.html file which can by executed in browser environment of mobile device to check if tests passes.

Help us improve this page