A module + test could look something like this:

   var uiModule = (function($){

   function init(){

   function getData(){
        return $.ajax({ url: 'something' });

   function addResultToUi(data){
        $('.dummy').append('<p>' + data.text + '</p>')

   function bindEvents(){
        $('.dummy').on('click', function(){

   return {
        init: init 

function setup(){

function tearDown(){
    uiModule = null;

test('data text added to dummy element', function(assert){
     var result = $('.dummy > p').text();
     assert.ok(result.length > 0);

test('click on dummy sets text to blah', function(assert){
     var $dummy = $('.dummy');
     assert.equal('foo', $dummy.text());

That looks like example code to me.

I think it would be best if the bounty was refunded and the question closed.


1 Answer 1


I agree with you. See this relevant information in the question :

A module + test could look something like this

This is a clear indicator that it is not real code but example code. I think we should refund and close the question, if the user don't want to provide the real code and real tests. I think it could be on-topic if would be about real code.

  • 2
    \$\begingroup\$ Agreed. I've refunded the bounty and put the question on hold. \$\endgroup\$ Apr 29, 2015 at 16:11
  • \$\begingroup\$ Should we custom-flag such bounty questions or treat them as 'normal' questions? \$\endgroup\$
    – Mast Mod
    Apr 30, 2015 at 13:35
  • \$\begingroup\$ You can't close a question when there is a bounty on it. Only a mod can refund the bounty and close the question. So flagging is the way, not you sure you can cast close vote. \$\endgroup\$
    – Marc-Andre
    Apr 30, 2015 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .