dizews/yii2-qunit

This package is abandoned and no longer maintained. No replacement package was suggested.

The QUnit extension for the Yii framework

Installs: 126

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 1

Open Issues: 1

Type:yii2-extension

dev-master 2014-07-07 07:04 UTC

This package is not auto-updated.

Last update: 2017-09-29 18:11:46 UTC


README

QUnit JavaScript Unit Testing framework for Yii2.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --dev --prefer-dist dizews/yii2-qunit "*"

or add

"dizews/yii2-qunit": "*"

to the require-dev section of your composer.json.

General Usage

To use this extension, simply add the following code in your application configuration:

return [
    //....
    'modules' => [
        'qunit' => [
            'class' => 'dizews\qunit\Module',
            //'runner' => ['template' => '@app/views/js-tests-runner/index'] //your own tests runner
        ],
    ],
];

You can then access QUnit through the following URL:

http://localhost/path/to/index.php?r=qunit

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/index.php/qunit

Directory structure of tests

...
tests/
    js/
        unit/
            fixtures    contains fixtures
            example.js  example of test
        test_helper.js  javascript test helper
        test_helper.css css test helper

Fixtures

All fixtures decorate by div with id which has a name fixture- + filename.