Page MenuHomePhabricator

Convert jasmin test for mediawiki.Uri module to qunit
Closed, ResolvedPublic

Description

keep em consistent :)


Version: unspecified
Severity: enhancement

Details

Reference
bz35769

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:14 AM
bzimport set Reference to bz35769.

Then add a layer of BDD on top of QUnit ? =)

(In reply to comment #1)

Then add a layer of BDD on top of QUnit ? =)

Not sure how serious I should take the wink, but I'll ask.. Why would we want to maintain two separate unit test frameworks for MediaWiki JavaScript?

Would you welcome someone adding the PHP SimpleTest framework to MediaWiki and start writing unit tests in it and then having to bridge that to PHPUnit for continuous integration?

Assuming no, lets just stick to converting it to QUnit.

btw, although QUnit may not be marked as BDD officially, its practically the same

  • QUnit:

module( '..', {
setup: fn(),
tearDown: fn (),
} );

test( '..', function () {

/* assertions: equal(), deepEqual, strictEqual, QUnit.ltOrEq, .. */

});

test( '..', function () {

/* assertions: .. */

});

  • Jasmine:

describe( '..', function () {

beforeEach( fn () );

it( '..', function () {
   /* assertions: expect.toEqual(), .. /
});

});

content hidden as private in Bugzilla

(In reply to comment #3)

(In reply to comment #1)

Then add a layer of BDD on top of QUnit ? =)

Not sure how serious I should take the wink, but I'll ask.. Why would we want
to maintain two separate unit test frameworks for MediaWiki JavaScript?

It is not a separated framework. Pavlov is build on top of QUnit, it is merely extending it just like PHPUnit_Extensions_Story_TestCase extends PHPUnit :-]