Skip to content

loadsys/TestJs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Console/cake TestJs.testjs_install

Usage

To use the plugin, load the plugin and be sure to enable the routes.

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
Configure::write('TestJs', array(
  'framework' => 'mocha',
  'chai' => 'expect'
));

About

Skeleton view files and assets for testing browser js code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published