How do I test and document my Ext.js code? Can’t find any information on their webpage.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Documentation
To generate Ext JS documentation, you can use any JavaScript documentation tool like JSDoc. There are also two Ext related documentation tools available: Ext-doc and JsDuck.
Testing
To test your Ext JS frontend you have different options:
For unit testing, there is the excellent Jasmin behavior-driven development framework available, which is used to test your JavaScript in isolation. It offers many functionality like matchers, spies, mocks and clock handling. I suggest to use the API documentation, since it offers more information that the main site.
Sencha itself is using Jasmine, you can see the core tests in
src/core/test/unit/spec. They even released a headless spec runner based on webkit: Headless Testing for Continuous Integration with Git and JasmineFor acceptance testing, you can basically use any acceptance testing tool like HTMLUnit or Selenium.
I personally use Capybara with the Selenium webdriver, but the advantage of Capybara is that there exists many other drivers for other technologies: capybara-webkit, Akephalos (uses HTMLUnit), Capybara-zombie, Capybara-phantomjs to name just a few.
The advantage of Selenium webdriver is, that it remote controls Firefox and it thus supports everything Firefox does. The other drivers are all meant for headless testing and are faster than Selenium but don’t support the same range of functionality. I regularly try every available driver for my growing test suite, but I always end with Selenium again.
Depending on your needs, you can stack Cucumber on top of Capybara, which uses test features written in a business-readable domain-specific language.
For testing your code automatically on file modification, I suggest you to try out Guard which has testing specific guards like Guard Jasmine headless webkit and Guard Cucumber and Guard Rspec for running Capybara tests.