yii2-qunit QUnit JavaScript Unit Testing framework for Yii2.

QUnit on Yii2

  1. Installation
  2. General Usage
  3. Directory structure of tests
  4. Fixtures

QUnit JavaScript Unit Testing framework for Yii2.

source: github

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 `divwithidwhich has a namefixture-` + filename.

0 0
3 followers
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: Others
Tags: qunit, test, unit, yii2
Developed by: dizews
Created on: Jul 4, 2014
Last updated: 10 years ago

Related Extensions