Skip to content

Instantly share code, notes, and snippets.

@he7d3r
Created September 15, 2014 13:06
Show Gist options
  • Save he7d3r/b75b1d93c49c88412e37 to your computer and use it in GitHub Desktop.
Save he7d3r/b75b1d93c49c88412e37 to your computer and use it in GitHub Desktop.
QUnit tests for TemplateScript
/**
* QUnit tests for TemplateScript.js
*/
/*jslint browser: true, white: true*/
/*global jQuery, mediaWiki, QUnit */
( function ( $, mw /* , undefined */ ) {
'use strict';
function myTests(){
function myFix( text ){
return text.replace(/a/g, 'A');
}
QUnit.module('Expressões regulares');
QUnit.test('foo bar', function () {
QUnit.expect(1);
equal(
myFix('alguma coisa'),
'AlgumA coisA',
'Cada "a" é trocado por um "A"'
);
});
}
mw.loader.using('jquery.qunit', myTests );
}( jQuery, mediaWiki ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment