LaxarJS Mocks
The companion testing framework for LaxarJS widgets.
Use LaxarJS Mocks on top of Jasmine to setup and load a widget just like in an actual application. The available APIs then support you in instrumenting and inspecting the widget under test.
For an introduction to LaxarJS Mocks have a look at the manuals. Additionally the API docs provide detailed information on the configuration, instrumentation and inspection possibilities.
Installation
Your LaxarJS application might have been created from a template that already includes laxar-mocks (check your bower_components
folder).
If not, follow these steps:
- Install
laxar-mocks
as a Bower dependency:
bower install --save-dev laxar-mocks
- Add the necessary entries to your RequireJS configuration (
require_config.js
), assuming that yourbaseUrl
is'bower_components'
:
paths: { // requirejs, laxar, angular, angular-mocks... // laxar-mocks specific paths: 'laxar-mocks': 'laxar-mocks/dist/laxar-mocks', jasmine2: 'jasmine2/lib/jasmine-core/jasmine', 'promise-polyfill': 'promise-polyfill/Promise' }
Note that Jasmine 2 is installed by Bower into its own directory to support different versions of jasmine to be used by different widgets.