https://github.com/loadsys/testjs
Skeleton view files and assets for testing browser js code.
https://github.com/loadsys/testjs
Last synced: 9 months ago
JSON representation
Skeleton view files and assets for testing browser js code.
- Host: GitHub
- URL: https://github.com/loadsys/testjs
- Owner: loadsys
- Created: 2013-03-26T00:30:09.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-09-01T00:47:29.000Z (over 12 years ago)
- Last Synced: 2025-04-04T20:51:22.406Z (10 months ago)
- Language: JavaScript
- Size: 324 KB
- Stars: 6
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TestJs Plugin
A plugin to quickly setup browser based javascript unit testing.
## Installation
Run the following shell command to install the default `test.ctp` view.
``` bash
Console/cake TestJs.testjs_install
```
## Usage
To use the plugin, load the plugin and be sure to enable the routes.
``` php
CakePlugin::load('TestJs', array('routes' => true));
```
To view the test page to `/testjs` in the browser (use `/app_name/testjs` if your app is in a sub directory). This url is only available when the app is not in debug = 0.
## Configure
To configure the plugin, write options with `Configure::write()`.
The valid framework options are:
- qunit - Use the qunit testing framework
- jasmine - Use the jasmine spec framework
- mocha - Use the mocha test/spec framework (also set chai for assertions)
The valid chai options are:
- assert - Use the assert assertion style
- expect - Use the expect assertion style
- should - Use the should assertion style
``` php
Configure::write('TestJs', array(
'framework' => 'mocha',
'chai' => 'expect'
));
```